You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically you can't just svgElement.className because SVGs are unique in that they have 2 class names. The best solution for this is to do svgElement.setAttribute('class', value)
You can see this in action by doing:
var svg = document.createElementNS( 'http://www.w3.org/2000/svg', 'svg' )
svg.className = 'my-class-name';
svg.className // doesn't return our set className, instead the special svg object
The text was updated successfully, but these errors were encountered:
Basically you can't just
svgElement.className
because SVGs are unique in that they have 2 class names. The best solution for this is to dosvgElement.setAttribute('class', value)
You can see this in action by doing:
The text was updated successfully, but these errors were encountered: