HTML and CSS Reference
In-Depth Information
2. In the
comments.js
file, write JavaScript code to add an event handler to the
Add
Review
form button to add comments to the Web page when clicked.
3. Write the code for adding comments to the form. The exact coding is left up to you,
but should include the following:
a. The HTML code for the comment should have the structure
<blockquote>
<p>
stars
</p>
<p>
comment
</p>
<p> -
username
</p>
<p>
date and time
</p>
</blockquote>
where
stars
is one or more inline images of stars (one star for every star rating
by the user),
comment
is the text of the user's comment,
username
is the name
specified by the user, and
date and time
is the text of the date and time when
the comment was submitted.
b. Each new block quote should be inserted in the reviews box before any other
comment is added to that box. Thus, the newest comments should be listed first.
4. Document your program with comments throughout.
5. Link the sample Web page to the
comments.js
file.
6. Test your file in your Web browser and verify that you can insert new comments into
the page by using the Web form.
7. Submit your completed files to your instructor, in either printed or electronic form,
as requested.
enDing DaTa FileS
tutorial.14
tutorial
review
case1
usconst.htm
switchstyle.js
toc.js
fed10.htm
keywords.js
styles.js
accents.htm
stylebox.js
case2
case3
case4
nodes.htm
tree.js
nflstats.htm
table.js
torte.htm
comments.js