Presentation is loading. Please wait.

Presentation is loading. Please wait.

Integrating JavaScript and HTML5 HTML5 & CSS 7 th Edition.

Similar presentations


Presentation on theme: "Integrating JavaScript and HTML5 HTML5 & CSS 7 th Edition."— Presentation transcript:

1 Integrating JavaScript and HTML5 HTML5 & CSS 7 th Edition

2 Describe JavaScript and how it can be integrated with HTML5 Describe how the tag container is used to display text Describe a valid JavaScript user-defined function Write the code to create a section on a Web page Chapter 9: Integrating JavaScript and HTML52 Chapter Objectives

3 Define and describe JavaScript variable Extract the current system date Calculate the number of days from the current date to a future date Use the innerHTML property to display a dynamic message to a Web page Chapter 9: Integrating JavaScript and HTML53 Chapter Objectives

4 Write a user-defined JavaScript function that changes the color of the browser’s scroll bar Write a user-defined JavaScript function to open a Web page from a tag value Use the lastModified property to display the date the document was last modified Use an event handler to invoke a JavaScript user- defined function when a Web page is loaded Chapter 9: Integrating JavaScript and HTML54 Chapter Objectives

5 Determine what you want the code to accomplish Determine where on the Web page you want the code to appear Determine where you want to store the Web page during development Chapter 9: Integrating JavaScript and HTML55 Plan Ahead

6 Chapter 9: Integrating JavaScript and HTML56 Built-In JavaScript Objects

7 Chapter 9: Integrating JavaScript and HTML57 Built-In JavaScript Objects

8 Chapter 9: Integrating JavaScript and HTML58 JavaScript

9 Chapter 9: Integrating JavaScript and HTML59 Entering a Tag Container

10 User-defined functions are normally written in the section so that this code is loaded before the remainder of the Web page Chapter 9: Integrating JavaScript and HTML510 Writing User-Defined Functions

11 Chapter 9: Integrating JavaScript and HTML511 Writing User-Defined Functions

12 Although JavaScript code can be placed anywhere in the HTML code in a section, developers follow the coding practice and place user-defined functions and variables in the section Chapter 9: Integrating JavaScript and HTML512 Inserting Tags in the Section

13 Chapter 9: Integrating JavaScript and HTML513 Entering the Start and Comment Tags

14 JavaScript uses variables to store values temporarily in internal memory A variable’s value can change, depending on the results of an expression or data entered by a user from a form Chapter 9: Integrating JavaScript and HTML514 Using JavaScript Variables

15 Chapter 9: Integrating JavaScript and HTML515 Using JavaScript Variables

16 Chapter 9: Integrating JavaScript and HTML516 Extracting the Current System Date Using the Date() Object

17 Chapter 9: Integrating JavaScript and HTML517 Calculating the Number of Days to a Future Date

18 Chapter 9: Integrating JavaScript and HTML518 Displaying Text and Variable Values to a Web Page Using innerHTML

19 Chapter 9: Integrating JavaScript and HTML519 Entering the User-Defined Function to Change the Browser Scroll Bar Color

20 Chapter 9: Integrating JavaScript and HTML520 Using the selectedIndex Property and the Location Object to Link to a New URL

21 Chapter 9: Integrating JavaScript and HTML521 Entering the User- Defined Function to Link to a New URL Using the Drop-Down Menu

22 Chapter 9: Integrating JavaScript and HTML522 Including the Date Last Modified and a Copyright Message in a Text String

23 Chapter 9: Integrating JavaScript and HTML523 Including the Date Last Modified and a Copyright Message in a Text String

24 Chapter 9: Integrating JavaScript and HTML524 Entering the End Comment and Tags

25 Chapter 9: Integrating JavaScript and HTML525 Associating User-Defined Functions with the onload Event

26 Chapter 9: Integrating JavaScript and HTML526 Associating a User-Defined Function with the OnChange Event

27 Describe JavaScript and how it can be integrated with HTML5 Describe how the tag container is used to display text Describe a valid JavaScript user-defined function Write the code to create a section on a Web page Chapter 9: Integrating JavaScript and HTML527 Chapter Summary

28 Define and describe JavaScript variable Extract the current system date Calculate the number of days from the current date to a future date Use the innerHTML property to display a dynamic message to a Web page Chapter 9: Integrating JavaScript and HTML528 Chapter Summary

29 Write a user-defined JavaScript function that changes the color of the browser’s scroll bar Write a user-defined JavaScript function to open a Web page from a tag value Use the lastModified property to display the date the document was last modified Use an event handler to invoke a JavaScript user- defined function when a Web page is loaded Chapter 9: Integrating JavaScript and HTML529 Chapter Summary

30 Chapter 9 Complete HTML 7 th Edition


Download ppt "Integrating JavaScript and HTML5 HTML5 & CSS 7 th Edition."

Similar presentations


Ads by Google