Prevent page load of images - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Image


Prevent page load of images

Demo Code

ResultView the demo in separate window

      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <img id="myImg" src="" width="107" height="98"> 
      <button onclick="myFunction()">Load image</button> 
function myFunction() {//from w  ww  . j a  va2 s . co m
    document.getElementById("myImg").src = "";


Related Tutorials