Last Updated: February 25, 2016
· iondrimba

How to check the element type of an event target with jQuery

If you have a click event attached to a container (ex: table row, div ) but inside the container you have a button that will perform a different click action you can check the of the container to see if the element clicked was a button type. {
    var isButton = $(":button");

    if(isButton) {
      //perform different action


This verification applies also to elements like :hidden , :submit, :checkbox, :radio and so on.

Say Thanks