• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Exercises

If you want to gain more experience using style sheets, try the following exercise:

  • Modify Listing 17.5 to include an <h2> tag with a subheading. Add a form element to select this tag's color, and a corresponding changeh2 function in the script.

  • Now that Listing 17.5 has three different changeable elements, there is quite a bit of repetition in the script. Create a single ChangeColor function that takes a parameter for the element to change, and modify the onChange event handlers to send the appropriate element ID as a parameter to this function.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint