I would like to reset the values of one set of form fields which belongs to the same class. for example,
<input type="checkbox" name"abc" id="abc" class="class1">
<input type="text" name"abc1" id="abc1" class="class1">
<input type="checkbox" name"abc2" id="abc2" class="class1">
onclick of another checkbox, I would like to reset the开发者_如何学JAVA above 3 fields. Please help.
$('#somecheckbox').click(function() {
$('input.class1').attr('checked', false);
});
I'd do this on document ready :
jQuery("#abc").bind("click", function(this){
jQuery( "." + jQuery(this).attr("class") ).val("");
});
精彩评论