1$( "#target" ).click(function() {
2 alert( "Handler for .click() called." );
3});
1$(document).on("click", ".onClass", function () {
2 //your code
3 var element = $(this); // to get clicked element
4});
1$( "#dataTable tbody tr" ).on( "click", function() {
2 console.log( $( this ).text() );
3});
4
1//1st way
2$(".searchCategory").click(function () {
3 //your code here
4});
5
6//2nd way
7$(".searchCategory").on( "click",getCategory); // getCategory is a function but don't need the pharenthesis
8//if you write getCategory() instead of getCategory when getCategory is a function with no pharamenters it might not work
1$( "#target" ).click(function() {
2 alert( "Handler for .click() called." );
3});
4