amazing things with elements on a webpage.
This is the easiest way to include JS in your page
You must use the <script> tag in your HTML file to link to the separate the JS from HTML
This image below shows a basic html page with a JS script
The script tag can appear anywhere in the file but it is important to understand that the code is
processed in the sequence it occurs in the file
Attached Script File
It separates HTML and code
The same JS code can be used by a number of HTML files and there is only one copy of the code file
Here is a basic html with an attached JS script
Running the program
Have a way of calling the code
1. Inline code executed as part of the page loading (as above)
2. Calling a function as part of the <body< tag:
3. When a button is pressed:
<button type="button" onclick=" procedure_name()">Click Me!</button>
and use indents to
show program logic.
All statements must end with a ; (semi-colon)
Variables are declared with the var keyword
or string for example.
integer or string for example.