I want to disabled the hyperlink after it was opened in new tab using one right click, so that I call the onmouseup
event and checked for right click and call disable function. But the disable functionality not work here. I don't want to hide the link, I just want to disable the link.
This is the HTML:
<html>
<body>
<a id="1" href="link1.html" onmouseup="if(event.button==2){disable(this.id)}">link_1</a>
<a id="2" href="link2.html" onmouseup="if(event.button==2){disable(this.id)}">link_2</a>
</body>
</html>
and JavaScript,
<script>
function disable(get)
{
document.get.style.display="block";
}
</script>
Can any one have idea on this?