Ein Selektor zum Filtern der Elemente, die das Ereignis auslösen. Für frühere Versionen bleibt es jedoch das effektivste Mittel zur Verwendung der Ereignisdelegierung. Im Allgemeinen sind dies die äquivalenten … } This method executes a function to run when the event occurs. Once we click 6n the text, the output is: Method to attach an event handler for the children of selected elements.
$("div").delegate("h2", "click", function(){ Syntax: Parameters of jQuery delegate() event. Definition and Usage. padding: 6px; Beachten Sie, dass .delegate () allen Absätzen - auch neuen - einen Click-Ereignishandler anhängt. padding: 6px; Please mail your requirement at hr@javatpoint.com. All rights reserved.
tag that is tag attach the event change background colour by using the jQuery delegate( ) method. The delegate () method is used to attach one or more event handlers for specified elements which are the children of selected elements. background: red; Developed by JavaTpoint. } Once click on the “Click ” button, the output is: Further when you click on any text that text get remove or slide toggle, as shown in the below output, This has been a guide to jQuery delegate().
tag attach the event change background colour by using the jQuery delegate( ) method. The delegate () method is used to attach one or more event handlers for specified elements which are the children of selected elements. background: red; Developed by JavaTpoint. } Once click on the “Click ” button, the output is: Further when you click on any text that text get remove or slide toggle, as shown in the below output, This has been a guide to jQuery delegate(). Welcome to delegate( ) method.
Weitere Informationen zur Ereignisbindung und .on() in der .on()-Methode. Parameters are: ChildSelector: … This method executes a function to run when the event occurs. This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. Click here for next. Parameter Description; childSelector: It is a Required parameter and is used to specifies one or multiple child elements … } h3 { – ontananza Oct 10 '16 at 17:41 Im Allgemeinen sind dies die äquivalenten Vorlagen für die beiden Methoden: Zum Beispiel der folgende .delegate() Code: entspricht dem folgenden Code, der mit .on() : .undelegate() zum Entfernen von Ereignissen, die mit delegate() .undelegate() , finden Sie in der .undelegate() -Methode. $( "body" ).delegate( "p", "click", function() { This is an example for jQuery delegate() Method background: red; Here we also discuss their introduction, syntax, parameters. with on() this behavior is the same?
It specifies one or more events to attach to the elements.
It specifies one or more events to attach to the elements.