1$( "#target" ).click(function() {
2 alert( "Handler for .click() called." );
3});
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$( "#dataTable tbody tr" ).on( "click", function() {
2 console.log( $( this ).text() );
3});
4
1// Html
2<input type="text" onchange="MyFuction(this)" />
3
4// Js
5function MyFunction(item) {
6 var input = $(item);
7 console.log(input);
8}