<html>
<body>
<h1>HTML DOM Events</h1>
<h2>The onload Event</h2>
<p>Use the addEventListener() method to attach a "load" event to an iframe element.</p>
<iframe id="myFrame" src="/default.asp"></iframe>
<p id="demo"></p>
<script>
document.getElementById("myFrame").addEventListener("load", myFunction);
function myFunction() {
document.getElementById("demo").innerHTML = "Iframe is loaded.";
}
</script>
</body>
</html>