It looks like the following code:
$("#logo-events").trigger("remove");
Same as
$("#logo-events").remove();
Is this expected behavior? You can try it on jquery by opening the console.
From the method documentation .trigger():
.trigger()
For ordinary objects and DOM objects other than a window, if the called event name matches the property name of the object, jQuery will try to call the property as a method , if there is no event, the handler calls event.preventDefault (). If this behavior is undesirable, use .triggerHandler () instead
.remove() DOM:
.remove()
remove() :- , .- .
, . "remove", jQuery .remove() node, .
jQuery/event.js:
if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { // ... elem[ type ](); // elem["remove"](); // ... }
.trigger() - , .remove() - , ( ). .trigger('remove'), , , .
, , . ( ) , . "on()".
( "#logo-events" ).on( "click", function() { alert( $( this ).text() ); }); $( "#logo-events" ).trigger( "click" );
, , , , , .
:
$("logo-events").trigger("remove");
.
, .
Source: https://habr.com/ru/post/1605967/More articles:HTML / CSS: focus a paragraph - javascriptWhere the java compiler saves its import mapping - javaUnable to download extensions for Jupyter laptops - ipython-notebookEditing and continuing the slow work of Visual Studio 2015 in a C # Winforms application - c #Reading file line by line with fgets in C, invalid size reading - cКак написать содержимое Flink var на экран в Zeppelin? - apache-flinkhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1605969/bootstrap-3-bleed-left-and-right-background-images-to-edge-of-browser&usg=ALkJrhiaGI8AGEgxrQCGrhkQm8nQEJBTrwHow to search for a phrase in all git? - gitHow does the ranger get the current user from the rack? - ruby | fooobar.comThe Persistence of Polyglot on Android - androidAll Articles