PDA

View Full Version : ID In javascript



thimmappa449
10-25-2010, 07:15 AM
hi all
in the following syntax document.getElementById('ID').innerHTML = 'value'; ID here is the element that has to be changed .is there any other way to use this method if the ID is not known.
Thanks In advance

djr33
10-25-2010, 08:08 PM
What do you know? You must know something in order to find the right element. The right method depends on the situation-- you can use several other identifiers such as: location (first child element of a known element, for example), class (like id, but can be several elements), type (table, a, div, etc), maybe id based on some other knowledge you can determine?