I have a set of SVG elements with the classes node and link. My program should detect whether an element has the node class or the l
node
link
l
Works. But be sure to close the function
$(".node").hover(function(evt){ console.log($(this).attr("class")); //returns "node" console.log($(this).hasClass('node')); //returns false }, function(){console.log("Done");});
http://jsfiddle.net/X6BPX/