[Javascript] accessing a <label>

Nick Wiltshire nick at customdesigns.ca
Sun Jun 3 19:10:48 CDT 2007


If the input is directly inside the label (as it should be) and you have a 
reference to the input, the label can be accessed through input.parentNode

On Sunday 03 June 2007 15:00, Rick Pasotto wrote:
> How do I access the <label> element associated with an <input>?
> I'd like to add a class to change the background if validation fails.



More information about the Javascript mailing list