1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <body>
<image id="lost" xlink:href="vert.gif" type="1t" x="10" y="10" width="20" height="20"></image>
</body>
<script type='text/javascript'>
var svgdoc=document.getElementById('lost');
var newnode = svgdoc.cloneNode(true);
newnode.setAttribute ('x', 15 ) ;
newnode.setAttribute ('y', 15 ) ;
newnode.setAttribute ('xlink:href', 'vert.gif') ;
newnode.setAttribute ('id', '12') ;
newnode.onclick= function(){alert("x="+this.x)}
document.body.appendChild(newnode)
</script>
</html> |