d3.selection()
Selects the root element, document.documentElement
. This function can also be used to test for selections (instanceof d3.selection
) or to extend the selection prototype. For example, to add a method to check checkboxes:
d3.selection.prototype.checked = function(value) { return arguments.length < 1 ? this.property("checked") : this.property("checked", !!value); };
And then to use:
d3.selectAll("input[type=checkbox]").checked(true);
Please login to continue.