Javascript examples for DOM:Event
Handle HTML DOM load event on iframe using javascript
<html lang="en"> <head> <title>Modify HTML DOM based on iframe using javascript</title> </head> <body translate="no"> <p id="removeText"> some text</p> <iframe src="https://www.java2s.com" name="iframe_a" id="iframe_a"></iframe> <a href="https://www.java2s.com" target="iframe_a">java2s.com</a> <script> document.getElementById('iframe_a').onload = function() { document.getElementById('removeText').innerHTML = ''; } /* www .j av a 2s .co m*/ </script> </body> </html>