A JavaScript file is just a text file (like HTML and CSS files are) but it has a ** . j s ** file extension, so save this file with the name add-content . j s
The HTML **
The source of the web page does not actually show the new element that has been added into the page; it just shows the link to the JavaScript file.
You may see JavaScript in the HTML between opening tags (but it is better to put scripts in their own files).
When the browser comes across a
A script is a series of instructions that a computer can follow one-by-one. Each individual instruction or step is known as a statement. Statements should end with a semicolon.
You should write ** comments ** to explain what your code does. They help make your code easier to read and understand. This can help you and others who read your code.
/* characters and ending with the */
characters. Anything between these characters is not processed· by the ** JavaScript ** interpreter.//
on that line will not be processed by the JavaScript interpreter. Singleline comments are often used for short descriptions of what the code is doing.A script will have to temporarily store the bits of information it needs to do its job. It can store this data in ** variables **.