Reputation: 2597
Question is simple, but i can't do that... Here my code:
jQuery('nav').on('click', 'a', function(event){
console.log(jQuery(this));
});
Upvotes: 0
Views: 83
Reputation: 36541
your codes looks fine.... but i think your are missing the document.ready
function
try this
jQuery(function(){ //ready function
jQuery('nav').on('click', 'a', function(event){
console.log(jQuery(this));
});
});
Upvotes: 1
Reputation: 35582
nav
must be a class or Id , a nav does not seem to be a standard tag
if its a class name
jQuery('.nav').on('click', 'a', function(event){
console.log(jQuery(this));
});
if its an Id
jQuery('#nav').on('click', 'a', function(event){
console.log(jQuery(this));
});
Here there is live demo: http://jsfiddle.net/netme/hx8HR/
Upvotes: 1