Created
October 9, 2019 20:03
-
-
Save matheusmurta/b5b3a149bd47855f8ddcbcad65affb33 to your computer and use it in GitHub Desktop.
Useful click classes events jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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