0
我試圖做一個if else
語句,當c
的值爲1時應該禁用按鈕按下,但我似乎無法讓它與d3.js
一起使用。如果else語句禁用按鈕
HTML
<button type="button" id="bt1" class="bt1">Previous 10</button>
<button type="button" id="bt2" class="bt2">Next 10</button>
JS
d3.select("#bt2").on("click",() => {
a += 10;
b += 10;
c += 1;
update(a,b,c);
});
d3.select("#bt1").on("click",() => {
a -= 10;
b -= 10;
c -= 1;
update(a,b,c);
});
if (c = 1) { d3.select("bt1").attr('disabled', 'disabled'); }