Tuesday, July 3, 2012

JQuery tips and tricks

Show or hide element with radio button

Scenario : when i click 'j3' (radio button), 'kodesuratkeluar' will show up.. when i select others it will hide
$('input[name="jenissurat_id"]').change(function() {
 if ($('#j3:checked').length) $('#kodesuratkeluar').show();
 else $('#kodesuratkeluar').hide();
});





No comments: