←
^
→
JavaScript in the Browser
Finding a Specific Element
document.getElementsByTagName('li')
returns array of elements with a given tag.
document.getElementById('firstline')
returns the
one
element with that unique id value. Very common.
document.getElementsByName('line')
returns array of elements with the given
name
attribute value. Does not seem to work with XHTML.
José M. Vidal
.
28 of 66