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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:15:47+00:00 2026-05-19T02:15:47+00:00

I want to do this: when you click a link on a page, it

  • 0

I want to do this: when you click a link on a page, it will open the link normally, but when you double click the link, it will alert the link’s ‘href’ attribute.

However, when I try to double click a link, it will always open the link. Any idea?

  • 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-19T02:15:48+00:00Added an answer on May 19, 2026 at 2:15 am

    The link opens after the first click of a double click, so you will need to add a time delay to determine which is which. Here’s some code (using the jQuery JavaScript library for brevity) that works on all the browsers except Internet Explorer (try it out). If you can figure out why it doesn’t, I’d like to know.

    $('a').click(function(event) {
        var elem = $(this),
            clickTimeout = elem.data('clickTimeout');
    
        if(clickTimeout) {        
            // Double click; cancel the single click timeout
            clearTimeout(clickTimeout);
            elem.data('clickTimeout', null);
    
            alert(elem.attr('href'));
    
        } else {
            // Might be a single click; wait and see
            elem.data('clickTimeout', setTimeout(function() {
                // Single click; timeout was not cancelled
                elem.data('clickTimeout', null);
    
                // Navigate to the link's URL
                window.location.href = elem.attr('href');
    
            }, 500));
        }
    
        // Stops propagation and prevents default action
        return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please go here and click on the link twice: http://bogsorken.com/test/index.html It will open up
i want to do when user go to this page the javascript form will
I want this: http://jqueryui.com/demos/dialog/#modal-message to happend when you click on ClickMe. how to do
I want to trigger on click of a button this: <asp:Button runat=server ID=submit Text=Submit
I want do something like this: Button btn1 = new Button(); btn1.Click += new
When click a button,I want to popup a view form bottom,like this! Any help
I want this for some conditional compilation code that will run in all IE's
I have a HyperlinkButton in my Silverlight project. Clicking the link will open the
When a user clicks on a link on my page, I want to be
This is going to be hard to explain but I'll try my best. I

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.