How to make an event to occur automatically in webpage using jquery?

We have to use this when we need to initiate an event where user doesn’t like to click or make an action. To do this, use the following function:

$('#id').trigger('change'); // to run onchange event
$('#id').trigger('click'); // to run onclink event

Similarly we can run any event.

Leave a Reply