d3 選択を使用してチェックボックスをオンまたはオフにするのが困難です。次のコードは機能していないようです。「チェック」を押すとすべてのチェックボックスがオンになり、「チェックを外す」が押されるとすべてのチェックボックスがオフになります。
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<button type='button' onclick='checkAll()'>Check</button>
<button type='button' onclick='uncheckAll()'>Uncheck</button>
<script src="http://d3js.org/d3.v2.min.js?2.10.0"></script>
<script>
function checkAll(){
d3.selectAll('input').attr('checked','true');
}
function uncheckAll(){
d3.selectAll('input').attr('checked','false');
}
</script>
</body>