Is there a way to test the type of an element in JavaScript?
The answer may or may not require the prototype library, however the following setup does make use of t
Perhaps you'll have to check the nodetype too:
if(element.nodeType == 1){//element of type html-object/tag if(element.tagName=="a"){ //this is an a-element } if(element.tagName=="div"){ //this is a div-element } }
Edit: Corrected the nodeType-value