0

i am using this inside Modal:

<a target="_blank" 
   id="changeme" 
   rel="noopener noreferrer" 
   href="javascript:void(0)"
>
  Visit Site here
</a>

but it still opens a new tab. Other answers were without target="_blank" tag.

Is it possible without using JS to make the link does nothing when clicked?

ravioli
  • 3,749
  • 3
  • 14
  • 28
bob mason
  • 677
  • 1
  • 6
  • 11
  • Check this out: https://stackoverflow.com/questions/8260546/make-a-html-link-that-does-nothing-literally-nothing – ravioli Oct 06 '19 at 07:55
  • Sorry, i could not post the ahref tag in the question, but your link is missing target="_blank". my example is: "a target="_blank" id="changeme" rel="noopener noreferrer" href="">Visit Site here – bob mason Oct 06 '19 at 07:59
  • So you want to leave the `target="_blank"` inside the , make the link unclickable, but still leave it looking like a link. Is that correct? – ravioli Oct 07 '19 at 10:02
  • I assume you have some auto-generating code that requires you to leave in the `"target="_blank"` attribute. I think you're going to have a hard time making this work on all browsers. Apart from the "how" part of your question, what is the "why"? What is your end goal for a user viewing the page with this link? – ravioli Oct 07 '19 at 10:04
  • I think this one does what you want - https://stackoverflow.com/questions/13955667/disabled-href-tag/13955695 – ravioli Oct 07 '19 at 11:15

0 Answers0