Ab*********@gmail.com wrote:
*OR* Before you run your mouth off about something you have no clue
about - being in this case that the mentioned JQuery is a JAVASCRIPT
LIBRARY supporting css / xpath / expressions to apply behaviors to dom
elements.
Or really? Which one of them? There are at least 3 plugin/library
called jQuery (variant JQuery) matching the OP's description. The name
is too "sound" for a bizword so all kind of wannabes used it for
software of all kinds of quality. Presuming for a minite it is not
about Eclipse but about <http://jquery.com/> (just one of numerous
variants). In such case I'm sure OP will be glafle helped at
<http://jquery.com/discuss/>
If OP wanted a JavaScript help, then the traversal should go in the
normal way, not upside down as (I presume) suggested by the "logic" of
the library. Namely on a standard-compliant page (thus all labels have
"for" attribute) one retrieves all labels for a given range and /then/
accesses the attached elements:
var labels = document.getElementsByTagName('LABEL');
var obj = null;
for (var i=0; i<labels.length; i++) {
obj = document.getElementById(labels[i].htmlFor);
if (obj.checked) {
labels[i].style.backgroundColor = 'red';
}
}
This is about JavaScript; for jQuery/JQuery/jquery use relevant URL's.