Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html lang="en"> <head> <title>DOMContentLoaded Example</title> </head> <body> <div id="output">Waiting for DOM...</div> <script> document.addEventListener('DOMContentLoaded', function() { document.getElementById('output').innerHTML = 'DOM fully loaded and parsed!' }); </script> </body> </html>