Selections, Drill 2

Write the function createSvg to create an svg element with attributes width and height both equal to 300. This svg element should be a child of the div with id svg-parent.

<body>
  <div id="svg-parent">
  </div>
  <script>
    createSvg(); // write this function
  </script>
</body>

Try it

Editor
Messages

  
DOM