jquery add click event to all elements with class code example
Example 1: jquery bind click
$( "#foo" ).bind( "click", function() {
alert( "User clicked on 'foo.'" );
});
Example 2: set onclick jquery
$(elem).click(myFunc());
$( "#foo" ).bind( "click", function() {
alert( "User clicked on 'foo.'" );
});
$(elem).click(myFunc());