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

Exercises

If you want to gain more experience using the DOM in JavaScript, try these exercises:

  • Add a third check box to Listing 19.1 to allow the paragraph of text to be shown or hidden. You will need to add an ID attribute to the <p> tag, add a check box to the form, and add the appropriate lines to the script.

  • Modify Listing 19.3 to add the entered text at the beginning of the paragraph instead of the end. You will need to replace the appendChild method with the insertBefore method.

  • Modify Listing 19.4 to scroll a short message in the heading of the page instead of in the table.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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