The aim of this exercise is to create the components of the page by directly constructing the DOM tree.
parentNode. A number of methods for manipulating the tree were also discussed, such as
replaceChild. Some other useful properties and methods include the
bodyproperty and the methods
An on-line reference for these (and other) properties and methods can be found in
DOM Reference at the Mozilla Developer Center.
Look up each of the above methods in the Gecko DOM Reference. Note
that some of the methods belong to
document and some
Write methods that pop up dialogue boxes asking the user to enter the page title, the heading (of the content section of the page), a paragraph of text, and the URL of a picture. The page should then be displayed with the correct title, and the heading, paragraph of text, and image in the content section of the page.
The function should be called addFinder, and when called it adds a text inputto the top of the web page, with a label "Search Regular Expression". Any text that is entered in this textfield is interpretted as a regular expression. When the textfield is updated a function searches all text in any element in a page, and any text macthing that regular expression is underlined.
There is a good online tutorial for using the canvas from W3Schools. For the second exercise of this lab work through the tutorial, and make sure that you understand all features used.