Javascript examples for DOM Event:Element Event Attribute
The onabort event occurs when the user aborts the loading of an <img> or <input type="image"> element.
Bubbles | Yes |
---|---|
Cancelable | No |
Supported HTML tags: | <img> and <input type="image"> |
Execute a JavaScript if loading of an image is aborted:
<!DOCTYPE html> <html> <body> <image id = 'demo' src='http://java2s.com/resources/a.png' onabort="myFunction()"/> <script> document.getElementById("demo").onabort = function() {myFunction()}; function myFunction() {//from ww w .ja v a 2s.co m console.log("abort"); } </script> </body> </html>