reading-notes

View the Project on GitHub Abu-laban/reading-notes

JAVASCRIPT

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

** LINKING TO A JAVASCRIPT FILE FROM AN HTML PAGE **

The HTML **

THE SOURCE CODE IS NOT AMENDED

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.

PLACING THE SCRIPT IN THE PAGE

You may see JavaScript in the HTML between opening tags (but it is better to put scripts in their own files).

** JAVASCRIPT RUNS WHERE IT IS FOUND IN THE HTML **

When the browser comes across a

** Basic JavaScript Instructions **

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.

** WHAT IS A VARIABLE? **

A script will have to temporarily store the bits of information it needs to do its job. It can store this data in ** variables **.

* RULES FOR NAMING VARIABLES *