tags:

views:

3308

answers:

1

in jquery, if i have the reference of an element, how can i know what kind of element is it, like an input or an dropdown ? is there any way to find out?

Duplicate:

http://stackoverflow.com/questions/341900/how-can-i-determine-the-element-type-of-a-matched-element-in-jquery

+11  A: 

The following will return true if the element is an input:

$("#elementId").is("input")

or you can use the following to get the name of the tag:

$("#elementId").get(0).tagName
Marius