score:4

Accepted answer

You need to provide a function to be called on mouseover. Your current code executes when the event handler is defined rather than fired. In this context, this is not defined and hence you're getting the error. The code you need is

link.on("mouseover", function() { d3.select(this).style("stroke","red"); });

Changed jsfiddle here. I've also made the distance between the nodes a bit larger so the links aren't obscured by the nodes and the event actually fires.


Related Query

More Query from same tag