Reputation: 315
I have some Problems with d3-selection.
I did it hundrets of times in my Project but now I have a hole in my head.
var draggedLine = d3.select('line');
works as expected (Returns the first line)
var draggedLine = d3.select('#76');
throws a Syntax Error in d3.v4.js.
d3.v4.min.js:2 Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '#76' is not a valid selector.
What is wrong here?Upvotes: 1
Views: 719
Reputation: 322
Solution Try this
var draggedLine = d3.select('[id="76"]');
Note: id should not start with number for better approach
Upvotes: 1