Handle element onerror event - Javascript DOM Event

Javascript examples for DOM Event:onerror

Description

Handle element onerror event

Demo Code

ResultView the demo in separate window


<html>
   <head> 
      <script>
function imgError(image) {/*from  www  .ja  v  a2s.  com*/
    image.onerror = "";
    image.src = "http://www.java2s.com/style/download.png";
    return true;
}

      </script> 
   </head> 
   <body> 
      <img src="image.gif" onerror="imgError(this);">  
   </body>
</html>

Related Tutorials