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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:21:21+00:00 2026-06-13T23:21:21+00:00

I have a link (anchor) that has an href attached to it to navigate

  • 0

I have a link (anchor) that has an href attached to it to navigate to a specific URL say ‘www.bla.com’.

<a href='http://www.bla.com' />

I also have an click handler attached to the link that performs some actions and then opens an html view in the same window. Everything works perfectly well.

However, when the user uses ‘ctrl+click’ to open the link in a new tab/window, the click handler seems to be taking precedence and opens the html view in the same window. But I want to retain the ‘ctrl+click’ behavior and allow the user open the link in a new tab/window (just as a normal link). How could I do that?

Thanks in advance!

  • 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-13T23:21:22+00:00Added an answer on June 13, 2026 at 11:21 pm
    function process(e){
       var evt = e ? e:window.event;
       if(evt.ctrlKey)
          alert("ctrlClicked");
    }​
    

    evt.ctrlKey will return true if control key is pressed, you can write your conditions within “if” block, I tested this for chrome and ff only.

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

Sidebar

Related Questions

I have a view that contains an anchor link. That link has an href
I have a link which looks like that: www.domain.com/file.php I want to create .htaccess
I have a tooltip that has a link to an anchor but it seems
I have next link that lets users navigate through a list of URL (stored
I have an anchor tag that has an href. I need to add a
I have link that calls a function when clicked: <a href=javascript:spawnMenu(this); id=link1>Test1</a> To make
I have this link in a template: <a href={% url show_item item.id %}>Item 1</a>
I have a link with 'remove' anchor text with href something like below: ./index.php?del_id=5
I have a table that has anchor links for all the rows in one
I have an anchor that doesn't go anywhere but has an onclick (e.g. <a

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.