77
rated 0 times
[
81]
[
4]
/ answers: 1 / hits: 25614
/ 8 Years ago, mon, february 1, 2016, 12:00:00
I wrote a simple code to add a line into my svg page when I click a button
This is the html
<body>
<svg width=500 height=400>
</svg>
<button id=btn1>Append text</button>
</body>
And the Script
$(document).ready(function(){
$(#btn1).click(function(){
$(svg).append(' <line x1=10 y1=10 x2=40 y2=40 style=stroke: black>' );
console.log(done!);
});
});
And jsfiddle
https://jsfiddle.net/dch7xyez/1/
The line gets appended but its not visible. Can anyone explain to me why?
More From » html