Does hillbilly slang fall under a type of English language and if not, what is it called? If you haven’t already created an account, you will be prompted to do so after signing in. Note that the object on which the event has occurred and the object whose event listener is being processed may be different. Die Eigenschaft currentTarget zeigt das Element an, ... Egal wohin man auf die Seite klickt, es wird immer das Element angezeigt, in dem der Eventhandler angeknüpft ist: body.
Why were the Magellanic Clouds named that way? Diese Seite wurde zuletzt am 12.
So if the whole
has the eventlistener event.target will be the clicked element, the
will be in event.currentTarget..

Hello highlight.js! jQuery: Difference between position() and offset(). Es bezieht sich immer auf das Element, an das der Ereignishandler angehängt wurde, im Gegensatz zu event.target das das Element identifiziert, auf dem das Ereignis aufgetreten ist. your coworkers to find and share information. What's the word for asking someone to deliver their promise? How Can I make a view that seems like Orthographic, but not exactly as well. © 2005-2020 Mozilla and individual contributors. Why did the Apollo capsule have seats if the astronauts never were sitting in it? Die Inhalte des SELFHTML-Wikis unterliegen der CC-BY-SA 3.0 (de). Making statements based on opinion; back them up with references or personal experience. What is the mean absolute difference between values in a normal distribution? this will be equal to whatever context you have provided, not Stack Overflow for Teams is a private, secure spot for you and JavaScript - Verarbeitendes Element und Zielelement, http://wiki.selfhtml.org/index.php?title=JavaScript/DOM/Event/currentTarget&oldid=36201. The parentElement property returns the parent element of the specified element.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy. rev 2020.9.24.37673, Stack Overflow works best with JavaScript enabled, Where developers & technologists share private knowledge with coworkers, Programming & related technical career opportunities, Recruit tech talent & build your employer brand, Reach developers & technologists worldwide. Check the form element triggered at onclick event, Using jQuery to test if an input has focus. Seems like they are equivalent in most cases, though "this" seems easier to type, according to http://api.jquery.com/event.currentTarget/. Is it considered plagiarism when you modify your professor's proof when solving a problem in a homework assignment? Wenn Sie das gerade angeklickte Kind- oder Enkelelement herausfinden wollen, benötigen Sie event.target. // do stuff with clicked element }) and #2 $('#selector').on('click',function(e){ $(e.currentTarget).... // do stuff with clicked element }) jquery javascript-events. Swapping out our Syntax Highlighter. is #1 faster than #2 ? What does this mean for the future of AI, edge…, What I learned from hiring hundreds of engineers can help you land your next…, Hot Meta Posts: Allow for removal by moderators, and thoughts about future…, Goodbye, Prettify. 182k 23 23 gold badges 217 217 silver badges 235 235 bronze badges.

Event.currentTarget is interesting to use when attaching the same event handler to several elements. This is my code. I think what you need is to use the event.currentTarget.This will contain the element that actually has the event listener. If you console.log() the event object, storing it in a variable, and then look for the currentTarget key in the console, its value will be null.