Stavin Li
2017-01-08 07:28为什么在javascript中动态创建的line标签在svg标签中显示不出来
<html>
<head>
<title></title>
</head>
<body>
<svg width="500" height="400">
<line x1="5" y1="5" x2="250" y2="200" style="stroke:black; stroke-width:1px;" />
</svg>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
var line = $('<line x1="5" y1="5" x2="4250" y2="400" style="stroke:black; stroke-width:1px;" />')
line.appendTo($('svg'))
</script>
</body>
</html>
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- 为什么在javascript中动态创建的line标签在svg标签中显示不出来
- svg
- javascript
- 1个回答