[Javascript] accessing a <label>

diego nunes dnunes at gmail.com
Sun Jun 3 21:29:39 CDT 2007


On 6/3/07, Mike Dougherty <mdougherty at pbp.com> wrote:
> The spec says either use for label is correct.  I think it depends on
> use which makes more sense.

    If using the label right before/after the <input> a good solution
would do a search for a label in the previousSibling/nextSibling,
comparing the "for" attribute. It wouldn't spend as much time as a
iteration through the whole getElementsByTagName('label') would.

  Amplexos.

--
diego nunes
dnunes.com



More information about the Javascript mailing list