if (!document.evaluate) {
alert("Sorry, cannot do that. Your browser does not support the evaluate method!");
return null;
}
var a_el = document.evaluate(".//tr/td/a[contains(@id, 'foo')]", table_node, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
Thanks, Aryeh.
$('table:eq(2)').find('a');
var tablea = table_node.find('a');
tablea.each(function(){
if ( $(this).attr('id').match(/foo/g) ) {
// do something with it
}
});
I think IE does not support this property. My suggestion is go with jQuery.
Check this out:
http://stackoverflow.com/questions/4681968/document-evaluate-cross-browser