How to Remove an Attribute in D3. Js?
Can I in D3. Js Remove an Attribute? I've Added It Using. Attr("Disabled", "Disabled") and Now I Am Looking for Something Similar to jQuery's...
Can I in D3.JS remove an attribute? I've added it using .attr("disabled", "disabled") and now I am looking for something similar to jQuery's .removeAttr("disabled", "disabled"); to remove it again. Useful for <button> and <option>. I've tried using the .remove() but that removes the entire object not the attribute.
1 Answer
From the API documentation for attr
A null value will remove the specified attribute
So it looks like you want .attr('disabled', null).