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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:52:18+00:00 2026-06-16T22:52:18+00:00

I want to register for events on a button in a web page using

  • 0

I want to register for events on a button in a web page using javascript addEventListener or something equivalent. But the web page doesn’t appear to have standard form buttons. The html snippet below is the html markup for what appears as a button on the page.

I want to detect mousedown (or mouseclick or equiv). Is there any way I could detect the user clicking on this button?

<a href="javascript:" id="WIN_0_536870914" arid=536870914 artype="Control" ardbn="Dial"    artcolor="null" class="btn btn3d arfid536870914 ardbnDial" style="top:247&#59; left:115&#59; width:46&#59; height:21&#59;z-index:1001&#59;">
<div class="btntextdiv" style="top:0&#59; left:0&#59; width:46&#59; height:21&#59;">
<div class="f1" style="&#59;width:46">Dial</div>
</div>
</a>
  • 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-16T22:52:19+00:00Added an answer on June 16, 2026 at 10:52 pm

    The only tricky bit will be getting the elements from the DOM in the first place. If you know the id then it’s trivial to get this specific button:

    var elem = document.getElementById('WIN_0_536870914');
    
    elem.addEventListener('click', function () {
      alert('click!');
    });
    

    http://jsfiddle.net/ugsYB/

    Although you probably want to target all the buttons by their class:

    var elems = document.getElementsByClassName('btn');
    
    var i;
    for(i = 0; i < elems.length; i++) {
      var elem = elems[i];
      elem.addEventListener('click', function () {
        alert('click!');
      });
    }
    

    http://jsfiddle.net/ugsYB/1/ (Note: there are cross browser issues with getElementByClassName)

    Of course, jQuery makes this sort of thing trivial:

    $('.btn').click(function () { alert('click!'); });
    

    http://jsfiddle.net/ugsYB/2/

    But it might be overkill for your needs.

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

Sidebar

Related Questions

In my web application i have registration form, when user register i want to
I have a google map in a page (Using the Javascript API v3) the
I want to register for screen resolution changes on the Mac. I have a
I have a win32 COM dll. I want to register this dll for different
I have created a COM Component in C++. Now i want to register my
NB: i´m using Twig in a non-Symfony context. I want to register a master
I have an animation running in the background, and I want to register a
I want my web's register users to store their location (latitude & longitude) from
I want to design a login and register layout using android tabs. Image is
If I have the classic ways to register and unregister events (+= -=), is

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.