Set default value unchecked (checkbox) to value=10 (JQuery)
Set default value uncheck (checkbox) to value=10 (JQuery).
If i unchecked i would to 开发者_开发技巧set value=10 of all every unchecked (check-box).
How to do that ?
Best regards
If checkbox value is to be set on document ready:
$(document).ready(function(){
$(".checkboxclass:not(:checked)").val("10");
});
If checkbox value is to be set on checkbox click:
$(".checkboxclass").click(function(){
if(!$(this).is(":checked")) {
$(this).val("10");
}
else {
//do something
}
});
精彩评论