tabs .click()

tabs .click()

I'm trying to execute a method when any tab inside of #tabs is clicked, could someone tell me what I am doing wrong?

  1. $('#tabs li').click(function() 
  2. {
  3. alert('clicked');
  4. });
Given the following html

  1. <div id="tabs">
  2. <ul>
  3. <li><a href="#tabs-1">Tab 1</a></li>
  4. <li><a href="#tabs-2">Tab 2</a></li>
  5. </ul>
  6. <div id="tabs-1"><p>Tab1 Stuff</p></div>
  7. <div id="tabs-2"><p>Tab2 Stuff</p></div>
  8. </div>
Thanks