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 7190239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:28:17+00:00 2026-05-28T19:28:17+00:00

I currently use the following code to trigger an event from my Firefox Add-On.

  • 0

I currently use the following code to trigger an event from my Firefox Add-On.

    var hiddenArea = document.getElementById("section_help");
    if (hiddenArea) {
        var evt = document.createEvent("MouseEvents");
        evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
        hiddenArea.dispatchEvent(evt);
    }

I tried to achieve the same with jQuery using

$("#section_help").trigger("click");

but it doesn’t work.
jQuery doesn’t trigger the event that was embedded by the original code.

Where is my fault?

  • 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-05-28T19:28:18+00:00Added an answer on May 28, 2026 at 7:28 pm

    The jQuery documentation mentions the following:

    Although .trigger() simulates an event activation, complete with a
    synthesized event object, it does not perfectly replicate a
    naturally-occurring event.

    It’s not really clear what they mean by that so I had to look at the source code. Apparently, jQuery doesn’t really create a native event object. It will merely trigger its own event handlers (the ones added via jQuery) and whatever it can find in onfoo properties. Event handlers added via addEventListener() won’t be triggered. Native actions associated with the event won’t be triggered (jQuery seems to be handling a few special cases however).

    To sum up: better stick with your old way of creating events. It might be more verbose but it does what you expect.

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

Sidebar

Related Questions

I currently use the following code to retrieve and decompress string data from Amazon
I currently use the following code to position a div directly below an input
Currently I use the following code to retrieve the IP address of the local
We currently use the following code to create an email in Outlook so that
I currently use the following code to sanitize a string before storing them: ERB::Util::h(string)
I currently use the following code to print a double: return String.format(%.2f, someDouble); This
I currently use the following code to upload one file to a remote server:
I use the following code currently if (oldValue) ... It works well in case
I currently use the following command, but it's a little unwieldy to type. What's
I am in the following predicament, i currently use Subversion for my source control

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.