Skip to main content

Command Palette

Search for a command to run...

[JavaScript] Advanced DOM and Events - Lifecycle DOM Events

Published
•View as Markdown
[JavaScript] Advanced DOM and Events - Lifecycle DOM Events
document.addEventListener('DOMContentLoaded', function (e) {
  console.log('HTML parsed and DOM tree built!', e);
});

window.addEventListener('load', function (e) {
  console.log('Page fully loaded', e);
});

// window.addEventListener('beforeunload', function (e) {
//   e.preventDefault();
//   console.log(e);
//   e.returnValue = '';
// });

lifecycle.PNG

JavaScript

Part 1 of 50

More from this blog

Jayden's Blog

166 posts