Does anyone know the d3 equivalent to jQuery attribute selector:
$('[attribute="name"]')
I want to be able to use d3 methods such as .transition(). Thanks!
It's the same in both D3 and jQuery; the underlying functionality is provided by the W3C Selectors API, so see the documentation on attribute selectors. For example, d3.select("[id=body]") is equivalent to d3.select("#body").
d3.select("[id=body]")
d3.select("#body")
1.4m articles
1.4m replys
5 comments
57.0k users