Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML Overview Part 5 – JavaScript 1. Scripts 2  Scripts are used to add dynamic content to a web page.  Scripts consist of a list of commands that execute.

Similar presentations


Presentation on theme: "HTML Overview Part 5 – JavaScript 1. Scripts 2  Scripts are used to add dynamic content to a web page.  Scripts consist of a list of commands that execute."— Presentation transcript:

1 HTML Overview Part 5 – JavaScript 1

2 Scripts 2  Scripts are used to add dynamic content to a web page.  Scripts consist of a list of commands that execute without user interaction.  JavaScript is code written into your HTML document within script tags:  The type attribute in the tag specifies which scripting language is used. // Display a greeting alert(“Hello World”);

3 Sample Script – Alert Box 3 // Display a greeting alert(“Hello World”);

4 // Display a greeting alert(“Hello World”);  The type attribute in the tag specifies which scripting language is used. 4

5 // Display a greeting alert(“Hello World”);  The type attribute in the tag specifies which scripting language is used.  // is used to add a single line comment that explains the script. 5

6 // Display a greeting alert(“Hello World”);  The type attribute in the tag specifies which scripting language is used.  // is used to add a single line comment that explains the script.  The alert function displays an alert dialog box. 6

7 // Display a greeting alert(“Hello World”);  The type attribute in the tag specifies which scripting language is used.  // is used to add a single line comment that explains the script.  The alert function displays an alert dialog box.  The text to be displayed in the dialog box is in quotation marks. 7

8 // Display a greeting alert(“Hello World”);  The type attribute in the tag specifies which scripting language is used.  // is used to add a single line comment that explains the script.  The alert function displays an alert dialog box.  The text to be displayed in the dialog box is in quotation marks.  A semicolon is used to end the JavaScript statement. 8

9  A message can also be displayed in the status bar of the browser window when your document is loaded. // Display a status bar message window.defaultStatus=“Hello World”; 9

10 Assignment 10 Work through the W3Schools HTML “How To” tutorial at: http://www.w3schools.com/js/js_howto.asp and the “Where To” tutorial at: http://www.w3schools.com/js/js_whereto.asp and the “Statements” tutorial at: http://www.w3schools.com/js/js_statements.asp Complete Practice: Computer viruses – Part 5 of 5 on page 60. Save as lastname_computerviruses5.html


Download ppt "HTML Overview Part 5 – JavaScript 1. Scripts 2  Scripts are used to add dynamic content to a web page.  Scripts consist of a list of commands that execute."

Similar presentations


Ads by Google