By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,349 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

Show Hide Question

P: n/a
Mel
i Have a table with two columns and a checkbox above it.
when the box is checked, i like to show the two <TD>s

i have:

<TD ID=1000 style=display=none>APPLE</TD>
<TD ID=1000 style=display=none>ORANGE</TD>

how can i do this with JS ?

i have used getElementById, but it only return one of the ids '1000'

thanks

Jul 11 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Mel wrote:
i Have a table with two columns and a checkbox above it.
when the box is checked, i like to show the two <TD>s

i have:

<TD ID=1000 style=display=none>APPLE</TD>
<TD ID=1000 style=display=none>ORANGE</TD>
This is invalid markup, id must be unique.

Use CSS classes, one for hidden and one for visible.

--
Ian Collins.
Jul 11 '06 #2

P: n/a
Mel wrote:
i Have a table with two columns and a checkbox above it.
when the box is checked, i like to show the two <TD>s

i have:

<TD ID=1000 style=display=none>APPLE</TD>
<TD ID=1000 style=display=none>ORANGE</TD>
This is very wrong. An id is a unique (per document) identifier, you can't
have two elements in the same document with the same id. Additionally, an
id cannot begin with a number.

Attribute values containing "=" characters must be quoted, and CSS uses
a ":" to assign a value to a property, not an "=".
how can i do this with JS ?

i have used getElementById, but it only return one of the ids '1000'
Use something else to identify the elements. There are a number of
implementations of getElementByClassName on the WWW.

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.