In my SVG, which you can see on pastebin here, I draw two identical shapes to use as sliders.
For the first, I pre-define the rectangle (and it’s fill), and then draw it with <use>. ID = “slider_1”.
For the other, I draw it straight out via <rect>. ID = “slider_2”.
When I feed slider_2 to my JavaScript, all is well.
When I implement on slider_1, the chrome console says I have an Uncaught ReferenceError: selectElement is not defined on line 87.
The slider functionality all still seems to work just fine, but since I’m trying to become more familiar with JS, I’d like to understand what the problem is, and why, and fix it.
There is no explicit call for a “selectElement” on that line, but that is the line of code targeted by the selector … beyond that, I’m at a loss 🙂
You have a call to
selectElement(evt)on line 44, but that function is never defined anywhere.