Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Useful click classes events jquery
$(window).click(function(e) {
console.log(e); // then e.srcElement.className has the class
});
$('div').click(function() {
var theClass = $(this).attr('class');
alert( theClass );
});
$(document).on('click', '.addproduct', function () {
// your function here
});
$('.test').click(function() {
console.log(this.id);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.