ページのどこかに、次のような構造を持つテーブルがあります。
...<td class="ind"><input type="checkbox" .../> ... </td>
<td><input type="checkbox" .../> ... </td>
<td><input type="checkbox" .../> ... </td>
<td>
クラスに含まれるチェックボックスごとに、ここind
に示すように、そのチェックボックスを不確定な状態に設定したいと思います
この作品を機能させるにはどうすればよいですか?
$(document).ready(function() {
var checkboxes = $(".ind").find(':checkbox');
for (var i = 0; i < $(checkboxes).length; i++) {
checkboxes[i].prop("indeterminate", true);
}
});