Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
-3
rated 0 times [  3] [ 6]  / answers: 1 / hits: 28675  / 12 Years ago, wed, april 25, 2012, 12:00:00

How do I return a specific attribute of a variable using d3?



For example, I want to select an element by mouseover, and pass on the selection to a function, but only if the element's id is a particular name.



Something like this?



d3.select(body).on(mouseover, function(){ 
if (d3.select(this).attr(id) == correct) {
enableInteraction(d3.select(this));
}
});

More From » d3.js

 Answers
30

Yes. Select this and then use the usual functions to access properties.


[#86000] Tuesday, April 24, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jelani

Total Points: 473
Total Questions: 99
Total Answers: 99

Location: Cape Verde
Member since Fri, Nov 27, 2020
4 Years ago
;