0
Q:

js trigger click

$( "#foo" ).on( "click", function() {
  alert( $( this ).text() );
});
$( "#foo" ).trigger( "click" );

$( "#foo" ).on( "custom", function( event, param1, param2 ) {
  alert( param1 + "\n" + param2 );
});
$( "#foo").trigger( "custom", [ "Custom", "Event" ] );
1
var element = document.getElementById('element');
element.click();
2
document.getElementById('myElementID').click();
1

New to Communities?

Join the community