Ask OfflineW!
Because every question deserves an answer

Sponsored

Practica
MCQ Practice — Offline
Sharpen your skills with quick, offline-ready MCQ tests for instant revision and exam prep.
  • 500+ curated MCQs
  • Timed quizzes
  • Instant feedback
Start Practicing
No signup offlinew.com/practica

Related

  • Practice MCQ
  • Tutorials
capture "open link in new tab" and "Open link in new window" event
10:04 07 Mar 2017

This is my code


whenever I am clicking on this link my function gets called using onclick event. I added onmousedown event for right-click capturing. But the problem is, this function gets called before selecting "Open in new tab" or "Open in new window" options. When the user uses right-click and before selecting the right-click options, the function gets called. I don't want this behavior. I want to call this function when the user actually selects "Open link in new tab" or "Open link in new window" options.

I don't want to show links in the status bar and also don't want to allow the user to copy the link address. That is why I used onclick and onmousedown events.

Please help me out. Thanks

javascript jquery

Your Answer

lock_outline

You need to log in to submit an answer.

Newsletter

Subscribe for updates

Advertisement

OffLine
Watch Videos — No Internet
Enjoy trending videos, watch offline anytime. Create, share & stay entertained — even when you’re offline.
  • Watch without internet connection
  • Create & share your videos
  • Fast, smooth & high-quality
Download Now
No signup needed offlinew.com
Terms Privacy Support
© 2025 OffLinew — All rights reserved

Privacy & Cookie Consent

We use cookies to ensure the best experience on our website. This includes analytics, personalization, and marketing purposes. Some cookies are essential for the website to function properly.

By clicking "Accept", you consent to our use of cookies. You can read more about how we use cookies and how you can change your preferences in our Privacy Policy.