O'Reilly logo

Essential JavaScript™ for Web Professionals, Second Edition by Dan Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Project I: Dynamically Selecting Multiple Form Fields

Here is the portion of the HTML page that contains the form named promotion, which holds the newsletter questions. It contains 10 checkboxes named content1 through content10 as well as a button that the user will click on to select all of the checkboxes.

 <td class="blkText"> <table border="0" cellpadding="5" cellspacing="0"> <tr> <td valign="top" align="left" class="blkText"> <input type="checkbox" name="content1" value="trends">Dirt<br> <input type="checkbox" name="content2" value="models">Moeny<br> <input type="checkbox" name="content3" value="designers">Trends<br> <input type="checkbox" name="content4" value="rage">Haute<br> <input type="checkbox" name="content5" value="gossip">Street<br><br> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required