Download presentation
Presentation is loading. Please wait.
Published byAugustine Welch Modified over 9 years ago
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
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.