0

I am trying to call a function when the user clicks on the first item on an unordered list. But it does not seem to work.

This is what I did:

$('#listResults li').first().on('click', function() {
    console.log('clicked');                         
});
user3312508
  • 819
  • 2
  • 10
  • 24
  • 1
    Dynamically created content? – Musa Aug 21 '14 at 21:28
  • @Musa Yes dynamically – user3312508 Aug 21 '14 at 21:32