I have the following HTML
<div>
<label for="username">Username:</label>
<input type="text" name="username" id="username" />
<span>some text here</span>
</div>
now I have referenced the input "username" in javaScript using getElementById rather easily but I need to locate (via javascript) the text of the label associated with the input, I'm thinking something like this:
document.getElement(thisName).parent.getElementsByTagName('label')[0].innerHTML;
Any help is appreciated