HTML and CSS Reference
In-Depth Information
10. Save your changes to the file, and then return to the
election.htm
file in your text
editor. Scroll down the document. After the Congressional Races
h1
heading, insert a
script
element containing the following commands:
a. Call the
showresults()
function using
race[0]
,
name1
,
party1
, and
votes1
as the
parameter values.
b. Repeat the previous command for the remaining four races, using
race[1]
through
race[4]
as the parameter values for the
race
parameter,
party2
through
party5
for
the
party
parameter,
name2
through
name5
for the
name
parameter, and
votes2
through
votes5
for the
votes
parameter.
11. Save your changes to the file, and then open
election.htm
in your Web browser.
Verify that the correct percentage appears for each candidate, and that a horizontal
bar chart representing the percent value is displayed next to each candidate.
12. Submit your completed Web site to your instructor, in either printed or electronic
form, as requested.
Case Problem 3
Explore how to
use JavaScript
to create an
auction log.
Data Files needed for this case Problem: ahstyles.css, aucttxt.htm, bidstxt.js, logo.jpg,
modernizr-1.5.js
Schmitt AuctionHaus
David Schmitt owns Schmitt AuctionHaus, an auction center
located in rural Indiana that specializes in estate and farm sales and auctions. He has
been looking at ways to improve the bidding process for silent auctions in which appli-
cants enter their names and bids for various items. David wants to create a Web page
containing bidding information on various items at the auction center. The bidding could
be displayed on a kiosk or terminal in the auction center, giving customers a quick look
at the current status of different items for sale.
David has asked you to help design a Web form to track bids for a sales item. The
form should include the name of the item, the current highest bid, a list of the bidding
history for the item, and a form in which new bids can be entered. Because mistakes
are sometimes made when entering a bid, David wants the ability to remove the last bid
from the list. Figure 12-38 shows a preview of a sample page you'll create for David.
Figure 12-38
auctionHaus bidding app