bradgrafelman;11023971 wrote:I suppose you could also do something similar without jQuery using XPath... although I do like the brevity of the jQuery syntax in this case.
The DOM/XPath version is about three times longer...
var hasChecked = document.evaluate('.//input[@type="checkbox"][@checked]',
document, null, XPathResult.BOOLEAN_TYPE, null).booleanValue;
If you're otherwise using jQuery there's no reason not to use it for this, but if you're not otherwise using jQuery it's a bit much.