About the head part of html | Sololearn: Learn to code for FREE!
+ 1

About the head part of html

So I’m doing the html course and it says head is where the non-visual elements go. Does this mean like the JavaScript to make a button function is in there? Don’t make the reply too complicated please as I’m just starting. Thanks!

27th Jan 2019, 9:41 PM
Jython
Jython - avatar
1 Resposta
+ 4
I’ll try to make my answer simple. The head element contains all the non-visible elements, that provide other metadata about the web page. For example, the title, and external files to be loaded BEFORE the actual document (that’s why it’s before the body element). So you can attach your JavaScript in there, but be aware that the document hasn’t fully loaded yet, so you won’t be able to manipulate elements from the DOM (you’ll learn about that later on). But yes, you can do that!
27th Jan 2019, 11:31 PM
Rowsej
Rowsej - avatar