+ 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!
1 Odpowiedź
+ 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!