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

  • Home
  • SEARCH
  • 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 7429625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:59:56+00:00 2026-05-29T08:59:56+00:00

jquery attaches a click method on even things that aren’t typically clickable like a

  • 0

jquery attaches a click method on even things that aren’t typically clickable like a DIV. this can be great because some things respond to that. How can i “click” on any old regular DIV using plain old javascript without Jquery?

what i am trying to do is trigger clicking on the area where the user can post in Jquery. I’m using a chrome extension that can run some javascript on a hotkey. I wrote a jquery version
var x = $(‘div[guidedhelpid=”sharebox”]’); x.click();

which works fine, other than it seems that the jquery library only loads about 1/4 of the time. not sure why, so i figured i’d try to make it in plain JS. As for the handler, googles own code is intercepting and processing the clicks fine, and it works in the Jquery version. so i just want to effectively do the same thing.

does Jquery internally go up or down the DOM until it finds the first think clickable?

update
in light of it, i was looking in the wrong direction, and really just needed to find the right element to focus on (in JQUERY).

  • 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-29T08:59:57+00:00Added an answer on May 29, 2026 at 8:59 am

    If you just want to bind one function to the element, you could use

    var element = document.getElementById("el"); //grab the element
    element.onclick = function() { //asign a function
    //code
    }
    

    but if you need to attach more than one event, you should use addEventListener (eveything except IE) and attachEvent (IE)

    if(element.addEventListener) {
    element.addEventListener("click", function() {});
    } else { 
    element.attachEvent("onclick", function() {})
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Jquery has a great language construct that looks like this: $(document).ready(function() { $(a).click(function() {
I have a jquery script that attaches a click event to every link, running
Given two spans like this: <span>Click for info</span> <span style=display: none>Here is a big
Okay I've tried multiple things and looked for answers to this and I can't
I'm trying to call a Page Method using a jQuery 'attached' event function, in
jQuery provides a browser neutral library for accessing and manipulating the DOM. This is
jQuery's getScript function doesn't seem to support an error callback function. I can't use
How can we know which javascript method is called and where it is defined?
I have a click function bound to many elements. It is possible that sometimes
I have a button(Button1) in a div element. Another button(Button2) outside that div may

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.