Node.js examples for DOM:Attribute
Get attribute from node by name
function getAttribute(node, name){ if(node.attributes.length > 0){ for (iu = 0; iu < node.attributes.length; iu++){ if(node.attributes[iu].name == name){ return node.attributes[iu].nodeValue; }//from w w w . ja va 2s . c o m } } return undefined; }