W3Schools.com

jQuery Event trigger() Method

jQuery Event Methods jQuery Event Methods

Example

Trigger the select event of an input element:

$("button").click(function(){
  $("input").trigger("select");
});

Try it yourself »

Definition and Usage

The trigger() method triggers specified event types for selected elements.


Trigger an Event

Specifies an event to trigger for the selected elements.

Syntax

$(selector).trigger(event,[param1,param2,...])

Try it yourself »

Parameter Description
event Required. Specifies the event to trigger for the specified element.
Can be a custom event (attached using the bind() function), or any of the standard events
[param1,param2,...] Optional. Additional parameters to pass on to the event handler.
Additional parameters are especially useful with custom events


Trigger an Event Using an Event Object

Specifies an event to trigger for the selected elements using an event object.

Syntax

$(selector).trigger(eventObj)

Try it yourself »

Parameter Description
function Required. Specifies the function to run when the blur event occurs


jQuery Event Methods jQuery Event Methods


WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE