Skip to Main Content
Head Rush Ajax
book

Head Rush Ajax

by Brett McLaughlin
March 2006
Beginner to intermediate content levelBeginner to intermediate
448 pages
13h 33m
English
O'Reilly Media, Inc.
Content preview from Head Rush Ajax
246
Chapter 4.5
Checking out top5.html
Open up top5.html and take a look. Most of the le is lled
with <img> elements to display the CD covers. You’ll also see some
instructions, a form with a button, and a few <div>s:
<html>
<head>
<title>Top 5 CD Recommendations</title>
<link rel=”stylesheet” type=”text/css” href=”top5.css” />
</head>
<body>
<div id=”instructions”>
Click on a CD cover to add it to the Top 5 list. If you want to start
over, click the “Start Over” button to clear the Top 5 list.
</div>
<div id=”cds”>
<img class=”cover” src=”images/vaughan_ood.jpg” />
<img class=”cover” src=”images/clapton_cream.jpg” />
<!-- Lots more images in here... -->
</div>
<div id=”top5-listings”>
<h2>My Top 5 CDs</h2>
<div id=”top5”></div>
</div>
<form>
<input type=”button” value=”Start Over” />
</form>
</body>
</html>
All these id
attributes will
help when we
need to look
these elements
up in our code.
Nothing tricky here...
just lots of <img>
elements to show the CD
covers to choose from.
Here’s where we’ll put the
CDs that the user chooses.
As usual, this app uses an
external CSS stylesheet.
We’ll probably need to run some
JavaScript here at some point...
the top5 cds html
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick
Head First Ajax

Head First Ajax

Rebecca M. Riordan

Publisher Resources

ISBN: 0596102259Errata PageSupplemental Content