Advertisement
LrdArc

jquery change attr

Jul 2nd, 2017
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. $( '#selectnya' ).change( function() {
  2. var value = $( this ).val();
  3. if ( value == 1 ) $( '#tanggal' ).removeAttr( 'required' );
  4. else $( '#tanggal' ).attr( 'required', 'required' );
  5. } ):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement