开发者

reset group of form fields - jquery

开发者 https://www.devze.com 2022-12-18 12:49 出处:网络
I would like to reset the values of one set of form fields which belongs to the same class. for example,

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("");
});
0

精彩评论

暂无评论...
验证码 换一张
取 消