JS Coding Questions Logo
JS Coding Questions
#176💼 Interview💻 Code

What are the ways to execute javascript after a page load

Advertisement

728x90

You can execute javascript after page load in many different ways,

1. window.onload:

javascript
1window.onload = function ...

2. document.onload:

javascript
1document.onload = function ...

3. body onload:

javascript
1<body onload="script();">

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 5

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
176of476
What are the ways to execute javascript after a page load | JSCodingQuestions.com