Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 8. Events > Getting the Correct Element When Using event.target

8.9. Getting the Correct Element When Using event.target

8.9.1. Problem

Your code is relying on the event.target[11] property of an event object, most likely in combination with event delegation, where one single event handler is bound to a container and it manages a variable number of descendant elements.

[11] http://docs.jquery.com/Events/jQuery.Event#event.target

In some cases, you don’t seem to be getting the expected behavior. event.target is sometimes pointing to an element that is inside the one you expected.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial