title: Delete and image on button click using javascript?
body: <p>i want to delete an image from s simple HTML page, when the delete button is pressed. I hav tried following code but it is not working, help please.</p>
  
  <pre><code>&lt;script&gt;
   function del()
   {
   var Node1 = document.getElementById(“i”);
   Node1.removeChild(Node1.childNodes[0]);
   alert("Image deleted");
   }
   &lt;/script&gt;
  
  &lt;img src="file:///C|/Users/momo/Desktop/uf.PNG" id="i"/&gt;
  &lt;button onclick="del()"&gt;Delete Image&lt;/button&gt;
  </code></pre>