3 function getElement(xpath, within) {
5 if (within === null || within === undefined) {
8 result = document.evaluate(xpath, within, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
9 if (result.snapshotLength !== 1) {
12 return result.snapshotItem(0);
15 var node = getElement(xpath);
21 if(node.tagName.toLowerCase() != "input"){
25 if(node.type.toLowerCase() != "checkbox" && node.type.toLowerCase() != "radio"){