Ticket #10760 (closed bug: invalid)
jQuery Selector for UI Tab Click Event
| Reported by: | jimmy.headdon@… | Owned by: | jimmy.headdon@… |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I'm not sure if this is a core jQuery issue or one of jQuery UI Tabs, but in IE8 with jQuery 1.7 and jQuery 1.8.16 if you try to bind to the click event of a tab as follows:
$('#jQueryTabs ul li a').live('click', function () {}); $(document).on('click', '#jQueryTabs ul li a', function () {});
Nothing will happen when you click on any of the tabs. However, if you change the syntax to be as follows it will work as expected:
$('#jQueryTabs ul li a').click(function () {});
I was under the impression that the .live() and .on() events would cover all of these scenarios?
Thanks!
Change History
comment:2 Changed 19 months ago by dmethvin
- Owner set to jimmy.headdon@…
- Status changed from new to pending
comment:3 Changed 18 months ago by jimmy.headdon@…
- Status changed from pending to new
Hello dmethvin,
Sorry for the delay, I've added a simple test case to JSFiddle here:
http://jsfiddle.net/FrKyN/132/
I've added the .click event (which works) in the middle of the .live and .on declarations, if you click a tab you'll notice that only the .click event fires.
Cheers!
comment:4 Changed 18 months ago by jimmy.headdon@…
Apologies I missed a closing </html> tag in the example, this is fixed in:
http://jsfiddle.net/FrKyN/134/
Cheers!
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.
Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.