Javascript examples for DOM Event:addEventListener
The onload event occurs when an object has been loaded.
Bubbles | No |
---|---|
Cancelable | No |
Supported HTML tags: | <body>, <frame>, <iframe>, <img>, <input type="image">, <link>, <script>, <style> |
<!DOCTYPE html> <html> <body> <iframe id="myFrame" src="http://java2s.com"></iframe> <p id="demo"></p> <script> document.getElementById("myFrame").addEventListener("load", myFunction); function myFunction() {/*from w ww . ja va2 s . co m*/ document.getElementById("demo").innerHTML = "Iframe is loaded."; } </script> </body> </html>