How to make HTML display before JS? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to make HTML display before JS?

I'm trying to make a heading to display before JS, and I'm not sure how. Can anyone help?

18th Apr 2020, 12:11 AM
Danial Azadpour
Danial Azadpour - avatar
3 Answers
+ 1
well u can just put the <script> at the bottom of the code specifically at the bottom of <body> tag Example: <body> <h1>Hello World!!</h1> <script src="path/to/yourfile.js"></script> </body>
18th Apr 2020, 2:45 AM
Mohammed Alotaibi
Mohammed Alotaibi - avatar
+ 1
The difference , as thought, is in the time delays...as an onload event will allocate the time the user waits for using the whole code will be placed at the beginning..But with using script tags the time delay will strart when the user initiates taking the action.
18th Apr 2020, 7:35 PM
Azad m. A.
Azad m. A. - avatar
0
Mirielle[Inactive] That only makes JS show for some reason.
18th Apr 2020, 8:21 PM
Danial Azadpour
Danial Azadpour - avatar