开发者

reset group of form fields - jquery

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜