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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:45:24+00:00 2026-06-04T16:45:24+00:00

I want to pass eventObject with trigger function, means when i manually trigger any

  • 0

I want to pass eventObject with trigger function, means when i manually trigger any event say:

 $(".test").bind({ click : Testing });

 $('.test').trigger("click");

 function Testing(e)
 {
 }

When the function testing is called by mouseclick , the parameter e contains the eventobject, so i want this same thing when we trigger it manually.Can we pass eventobject when we trigger any event manually, Is this possible?

  • 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-04T16:45:25+00:00Added an answer on June 4, 2026 at 4:45 pm

    As gdoron points out (+1), jQuery will supply the event object for you. But you can create it explicitly if you like, to fill it in with information that jQuery can’t fill in for you. You can create an Event object and pass it into trigger.

    Here’s an example of both using the default event object and creating your own: Live copy | source

    jQuery(function($) {
    
      $(".test").click(function(e) {
        display("Received click on target");
        display("typeof e = " + typeof e);
        if (e) {
          display("e.type = " + e.type);
          if (e.type === "click") {
            display("Coords: (" + e.pageX + "," + e.pageY + ")");
          }
        }
      });
    
      //Create a new jQuery.Event object without the "new" operator.
      var e = $.Event("click");
    
      // Fill in more info
      e.pageX = 42;
      e.pageY = 27;
    
      // Trigger an artificial click event
      display("Issuing a click via <code>$('.test').trigger('click')</code>");
      $('.test').trigger("click");
    
      // Trigger an artificial click event
      display("Issuing a click creating our own event object with more info on it.");
      $('.test').trigger(e);
    
      function display(msg) {
        $("<p>").html(msg).appendTo(document.body);
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

want to pass boost::bind to a method expecting a plain function pointer (same signature).
I want to pass some values to different forms at there button click event.
I want to call a function onclick and pass the event object to the
I want to pass an array of arbitrary struct pointers and a comparison function
I want to pass some dynamic paramters to jquery onClick event. Before, I used
I want to pass the parameter that List.sortBy takes through to another function. My
I want to pass 2 arrays to a function in Java and have them
I want to pass a date object into a function and determine what the
I want to pass variable arguments to makecontext function as follows. void a(...) {
I want to pass 2 javascript events in one click, I put 2 of

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.