Q:

is an element an input? 

How can you check if an element is an input? 
if(elm.val() == null){
// is not an input
}
else{
// is an input
}

A:

Well you know what element you are selecting. 
or (if you really do not know) you can do:
if(elm.is('input')) {} //assuming elm is a jQuery element
else {}

