hajim urcs
Computer Science @ Rochester

DMS102/CSC170D: Introduction to Web Development
Spring 2013

Assignment 8: DOM

For each of the following questions, start with the example document linked here: dom-example.html. You can of course also experiment with other documents as you explore the DOM.
  1. [4 pts] Add a script element at the end of the document body that asks the user for some text and sets both the toplevel heading and the document title to that text.
  2. [4 pts] Add a script element at the end of the document body that asks the user for some text and adds it as a new item in the second list.
  3. [4 pts] Add a script element at the end of the document body that asks the user for an element id and then makes the element with that id (if any) disappear. Be sure to check that there is such an element. Lookup the display CSS property (and corresponding property of the element's style object) for how to make it disappear.
  4. [4 pts] Add a script element at the end of the document body that first asks the user for an element id. If there is such an element, ask the user for a color name and set the element's style object's color property to that color.
  5. [4 pts] Add a script element at the end of the document body that asks the user for an HTML class name and a color name, and then sets the color of all the elements of that HTML class to the given color.

Things to think about

Last update: Friday, 05-Apr-2013 14:51:55 EDT