Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8867127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:57:14+00:00 2026-06-14T16:57:14+00:00

In jQuery what is the better way to trigger an event such as click?

  • 0

In jQuery what is the better way to trigger an event such as click? Using the .trigger('click') function or calling .click()?

I have always triggered this event by using .click() but suddenly decided maybe I should be using .trigger('click') instead.

I use these event triggers to trigger event listeners created with .on('click', function(){...}).

I have checked the jquery api, searched other stackoverflow posts [ 1 ] [ 2 ] and I can see no reason to use one over the other.

I would be more inclined to use .trigger() to keep all event triggering consistent, as this can be used to call any event including custom events. But it would seem .trigger() does not work in all cases.

What is the best way to trigger an event? .trigger('click') or .click()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:57:16+00:00Added an answer on June 14, 2026 at 4:57 pm

    If you’re using .trigger() you have the advantage of being able to pass additional parameters, whereas .click() must be called without any.

    Taken from the documentation:

    $('#foo').bind('custom', function(event, param1, param2) {
      alert(param1 + "\n" + param2);
    });
    $('#foo').trigger('custom', ['Custom', 'Event']);
    

    'Custom' and 'Event' are being passed to the event handler as param1 and param2 respectively

    Besides that, the .click() is unlike other functions that implement get / set based on the number of arguments, because it implements trigger / set instead. Using a dedicated .trigger(), to me, is more logical.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a better way to do this jquery code? Currently I have to
Anybody have a better way to write this jquery method. If a user comes
Is there a better way to do this jQuery selection: $(p.DynFieldWrapper :input:not(:text):not(textarea)).focus(HideDynamicFormError).click(HideDynamicFormError); $(p.DynFieldWrapper :text,p.DynFieldWrapper
I am wondering if there is a better way to write this JavaScript (Jquery)
Jquery did not carry out!!!I don't know why $(.other-edithion).click(function(){ var city = $(this).closest('#city'); if
Is there a better way to do this in jQuery? Depending on the end
Possible Duplicate: Is there an “exists” function for jQuery Is there a better way
Is there a better way to write this so I don't have to use
I'm trying to achieve some animation using jQuery. I have it working but I'm
Is there a better way then using jQuery.browser , or equivalents , for determining

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.