What noticable difference is there?: placing script within the <head> as opposed to within the <body> | SoloLearn: Learn to code for FREE!

0

What noticable difference is there?: placing script within the <head> as opposed to within the <body>

3/8/2019 2:29:47 PM

Nabbacus

2 Answers

New Answer

+5

Difference is only style and readable code... Now days css JavaScript used external link in modern website for better understanding..

+4

The scripts in head run before body is loaded. Any attempts to retrieve DOM will return null. The scripts in end of body allows attempts to retrieve DOM, which in turn supports setting properties or event listeners to the DOM.