Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
<script src="http://d3js.org/d3.v3.min.js"></script>    
    <meta charset="utf-8">
    <title>JS Bin</title>
  </head>
  <body>
    <svg width="350" height="150" id="mysvg">
      <!--image xlink:href="http://placehold.it/350x150" width="350" height="150" y="0" x="0"/-->
    </svg>
    
    <div id="target"></div>
  </body>
</html>
 
var mysvg = d3.select('#mysvg');
var src = 'http://placehold.it/350x150';
mysvg.append("image")
  .attr("width", 350)
  .attr("height", 150)
  .attr("xlink:href", src);
var img = document.createElement('img');
    img.src = src;
document.getElementById("target").appendChild(img);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
rafaelcastrocoutopro
0viewers