HTML and CSS Reference
In-Depth Information
Apply Your Knowledge
Reinforce the skills and apply the concepts you learned in this chapter.
Instructions : Start Notepad++. Open the file apply10-1.html from the Chapter10\Apply folder of the
Data Files for Students. See the inside back cover of this topic for instructions on downloading the
Data Files for Students, or contact your instructor for information about accessing the required files.
The apply10-1.html file is a partially completed HTML file for the Crab Apple Heights Elementary
School that you will use for this exercise. You will use JavaScript to create a scrolling message and validate
three text fields: parent or guardian name, cell phone, and e-mail address. The parent name and cell phone
fields must not be blank. The e-mail address must include an @ sign for a valid e-mail address. You must
add the event handler in the <body> tag to call the scrolling message function and the event handler in the
Submit button to call the validate function. Figure 10-41 shows the Apply Your Knowledge Web page as it
should be displayed in a browser after the JavaScript has been added.
text field with
scrolling message
form with text
fields, Submit and
Reset buttons
Figure 10-41
Perform the following tasks:
1. Enter the beginning of a JavaScript code section for a user-defined function in the <head> section
of the Web page.
2. Using the code presented in Table 10-1 on page HTML 458 as a guide, enter a form for the
scrolling message after the <div> tag following the brown divider line. Use Message as the name
of the form and msgBox as the name of the text field.
3. Using the code in Tables 10-2, 10-6, and Figure 10-10 on pages HTML 459, 463, and 464,
respectively, as a guide, write a JavaScript user defined function called scrollingMsg() to display the
following text string, “The next school board meeting will discuss the playground funding issue.”
Be sure to leave a space before and after the text string message.
Continued >
 
Search WWH ::




Custom Search