d3.select(this) works on mouseover, but not on function called in mouseover
问题 I am new to javascript and currently struggling with selecting the this object while trying to do a d3 selection. I've made the following example, with a function I'm calling, and an on mousemove event: function changeFont() { d3.select(this) .attr('font-size', '2em') } ... .on('mousemove', function() { var mouse = d3.mouse(this); var xVal = mouse[0]; // this would work, but not when its called in a function // d3.select(this) // .attr('font-size', '2em') // this works d3.select(this) .attr(