jquery click on class code example

Example 1: jquery click event

$('#selector').on('click',function(){
    //Your code here
});

Example 2: css click event jquery

$('h1').click(function () {
        $(this).css('color', 'blue')
    });

Example 3: jquery onclick function

$( "#other" ).click(function() {
  $( "#target" ).click();
});

Example 4: jquery is triggered on every element with class name

$(".yourButtonClass").on('click', function(event){
    event.stopPropagation();
    event.stopImmediatePropagation();
    //(... rest of your JS code)
});

Tags:

Css Example