Q:

get the tag name of object returned by getElementsByName

so suppose I call document.getElementsByName("title"); in javascript
and I want to know the type of the tag of the element that is returned by that function, for instance, to see if it's a meta tag or a div tag or a span tag, etc
how would I go about doing this? 

A:

document.getElementsByName("title"); returns a set of elements not a single element
so within a cycle you could use element.tagName to get the tag
basicly
document.getElementsByName("title")[0].tagName should work

A:

You have returned a NodeList object, so you would need to be more specific with your selector, or choose the first element using an index of 0, as in the other answers.
Whilst you can use nodeName or tagName, nodeName is the better option.

