【发布时间】:2021-07-16 22:36:03
【问题描述】:
我的 d3 树中有复选框。我的代码如下。
nodeEnter.append('foreignObject').attr('width', '20')
.attr("x", 200 / 2)
.attr("y", 1)
.attr('height', '20').append('xhtml:input')
.attr('type', 'checkbox')
// An on click function for the checkboxes
.on("click",function(d){
console.log(d)
});
从这段代码中,我可以在单击复选框时捕获数据。但是有了这个我想知道复选框是否被选中。我该怎么做?
【问题讨论】:
标签: javascript angular d3.js angular8 angular9