Label properties for form elements
Ok, this is pretty simple, but if you've ever wished that the DOM exposed a label property for any form element that had a label specified for it, well, you'll enjoy this.
!! UPDATED A FEW POSTS DOWN !!
Just pass it a reference your form and voila! You now have element.label :D
function addLabelProperties( f )
var labels = f.getElementsByTagName( "label" );
for ( var i = 0; ( label = labels[i] ); i++ )
f.elements[label.htmlFor].label = label;
Will this help with my post?
I was wondering if this will help me out with the my post about reading the labels of radio and check buttons? I am extremely new to this and would like an example of how to use your function. Any help would be appreciated.