I need to create an empty HTML tag which is self-closed, like
<line style="stroke:rgb(0,0,255); stroke-width:2"/>
with the following code:
$("<line/>").css({
stroke: "rgb(0,0,255)",
"stroke-width": 2
});
but I always get
<line style="stroke: rgb(0, 0, 255); stroke-width: 2px;"></line>
which doesn't work for SVG.
How I can explicitly cause jQuery to do that?
UPDATED:
I found a solution, but with pure JS: jquery's append not working with svg element?