Java Reference
In-Depth Information
Exercise Questions
Suggested solutions to these questions can be found in Appendix A.
1.
Here's some HTML code that creates a table. Re-create this table using only JavaScript and the
core DOM objects to generate the HTML. Test your code in all browsers available to you to
make sure it works in them. Hint: Comment each line as you write it to keep track of where you
are in the tree structure, and create a new variable for every element on the page (for example,
not just one for each of the TD cells but nine variables).
<table>
<thead>
<tr>
<td>Car</td>
<td>Top Speed</td>
<td>Price</td>
</tr>
</thead>
<tbody>
<tr>
<td>Chevrolet</td>
<td>120mph</td>
<td>$10,000</td>
</tr>
<tr>
<td>Pontiac</td>
<td>140mph</td>
<td>$20,000</td>
</tr>
</tbody>
</table>
2.
It was mentioned that Example 10 is an incomplete tab strip DHTML script. Make it not so
incomplete by making the following changes:
Only one tab should be active at a time.
Only the active tab's description should be visible.
Search WWH ::




Custom Search