Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
1行に1つのチェックボックスがあるテーブルがあります。jQueryですべてのチェックボックスを選択したいのですが、id='selectAll'を持つ最初のチェックボックスは選択しません。
どうすればそれを達成できますか?
使用しないでください:
$('input[type="checkbox"]').not('#selectAll')
または、最初のチェックボックスを除くすべてのチェックボックスを選択するには、gt:を使用することもできます。
$('input[type="checkbox"]:gt(0)')
それを行う多くの方法の1つ..
$(':checkbox', '#tableID').filter(function () { return this.id != 'selectAll'; }).prop('selected', true);
$('input[type="checkbox"]').not('#id')