I want to check specific attributes of the target during the click event:
$('div').on('click', function(e) { console.log(e.target.attr('class')); });
This results in an error in the browser console:
main.js: 47 Uncaught TypeError: e.target.attr is not a function
Is event.target a jQuery object also?
javascript jquery
Filip bartnicki
source share