JS/jQuery - get the type of element
Use something like this:
$(".selector").click(function(event){
var element = event.target.nodeName }
$(this).is("a")
, for example, will also work. This is useful if you're checking against a more complicated selector, not just a particular element type.
Use nodeName
or tagName
.