For a long time, web page authors used <div> elements to group together related elemets on the page, but this method was kinda complicated, so they startd using the new HTMLS elements that provide a clearer code compared to the old method. HTML5 elements help to describe the stucture of web pages so the majority of the websites started using HTML5.
is has two functions depinding whether is is inside <article> or not:
To group together a set of one or more h1 to h6 elements.
Before you learn how to read and write the JavaScript language itself, you need to become familiar with some key concepts in computer programming and they are three sections:
script is a series of instructions that a computer can follow to achieve a goal. It’s like a manual er a recibe that you follow to make or cook something, and the browser may use different parts of the script depinding on how the user interacts with the web page.
To write a script, you need to first state your goal and then list the tasks that need to be completed in order to achieve it.
Computers create models of the world using data, these models use objects to represent physical things, objectts can have:
web browsers use the HTML to create a model of the web page, and to make web pages interactive, you write code that uses the browsers’s model of the web page.
It is best to keep JavaScript code in its own JavaScript file. JavaScript files are text files (like HTML pages and CSS style sheets), but they have the . j s extension.
The HTML
If you view the source code of the page in the browser, the JavaScript will not have changed the HTML, because the script works with the model of the web page that the browser has created.