×

Sign in with twitter.

You can follow the user and hashtags.

Share your tips on social media.

Post relative tips.

If you have relative tips, click [Add relative tips] to post.

jQueryで全てのチェックボックスのチェックを簡単に変更する

@t_macki@t_macki 1801 viewer 54 embed viewer embed
<input type="checkbox" id="all" />全て
<input type="checkbox" >1</input>
<input type="checkbox" >2</input>
<input type="checkbox" >3</input>

$(function (){
$("#all").click(function(){
if(this.checked){
$("input[type='checkbox']").attr('checked', true);
} else{
$("input[type='checkbox']").attr('checked', false);
}
});
});


#tipshare
#jQuery

Click this to change format.

Add relative tips

Users who share this tip.

Comments