[Javascript] hiding single td cells

David Dorward david at dorward.me.uk
Tue Apr 25 07:01:49 CDT 2006


On Tue, Apr 25, 2006 at 01:58:18PM +0200, Michael Borchers wrote:
>    <table>
>    <tr>
>    <td id="cell[]"></td>

Ids cannot include the characters "[" or "]".

>    <td></td>
>    <td id="cell[]"></td>

An id must be unique within a document.

>    now i want to hide all td tags with the cell ID,

First switch to using class. Then change the value to something
allowed. Then run your document through the W3C Markup Validation
Service. Then use getElementsByTag name to find all the table data
cells. Then loop through them checking the className property. Alter
the style.display property of those that match.

-- 
David Dorward                                      http://dorward.me.uk




More information about the Javascript mailing list