Vikal Singh has Published 1 Articles

How to trigger event in JavaScript?

Vikal Singh

Vikal Singh

Updated on 03-Oct-2019 06:38:20

627 Views

The trigger() method triggers the specified event and the default behaviour of an event (like form submission) for the selected elements.For example: $( "#foo" ).on( "click", function() {   alert( $( this ).text() ); }); $( "#foo" ).trigger( "click" );

1
Advertisements