Skip to main content

Bug Tracker

Side navigation

#12993 closed bug (invalid)

Opened December 03, 2012 09:59AM UTC

Closed December 19, 2012 08:51AM UTC

jquery, on, event target

Reported by: fingerpasser Owned by: fingerpasser
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:
Description

html:

<ul>

<li><span>001</span></li>

<li><span>002</span></li>

<li><span>003</span></li>

</ul>

js:

$(document).on('click','li',functioin(e){

//why the e.target is span, not li, and how can i get the li without change the html.

});

Attachments (0)
Change History (3)

Changed December 03, 2012 12:13PM UTC by rwaldron comment:1

owner: → fingerpasser
status: newpending

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.

Changed December 04, 2012 11:54AM UTC by anonymous comment:2

I believe this is expected behaviour.

in the example, within the handler function 'this' will be a reference to the 'li' element, but the event target ('e.target') IS the span.

Changed December 19, 2012 08:51AM UTC by trac-o-bot comment:3

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!