I'm trying to unhide an SVG image from my page with jQuery. The code is:
if ( slotNumber == cardNumber ) {
$('#bub3').attr("class", 'bub3');
$('.bub3').removeClass("hidden");
...
}
My SVG looks like:
<svg class="hidden" id="bub3"
width="1200" height="120"
viewPort="0 0 120 120" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<polyline
class="path "
stroke-linejoin="bevel"
points="20,100 60,20, 350,20"
stroke="black"
stroke-width="2"
<path d="M20 100 L60 20 L350 20 Z" />
/>
</svg>
I know, that removeClass()
does not work with SVG, that's why I'm trying with attr("class", "bub3")
, but that does not seem to work either. The SVG stays hidden. removeAttr("class")
works, but I want to keep certain classes, not get them all removed.
Any ideas why attr("class", "bub3")
does not work?