Get current SVG change value using javascript
I want to get the current "stroke" value for a specific svg element. This is not a problem if the value was set using javascript before, but when it is set by the class, I cannot seem to get the return value using the following scripts ...
el.getAttribute('stroke') //returns 'null'
el.setAttribute('stroke','red') // the stroke is visibly changed to 'red'
el.getAttribute('stroke') //returns 'red'
So how do I get the current value when set via style?
+3
source to share