|
Prev: Formfield not updated
Next: Troubleshoot script
From: Mel on 11 Jul 2006 18:11 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
From: Ian Collins on 11 Jul 2006 18:17 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.
From: David Dorward on 11 Jul 2006 18:28 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
|
Pages: 1 Prev: Formfield not updated Next: Troubleshoot script |