Skip to content

Instantly share code, notes, and snippets.

@Xeroday
Last active December 17, 2015 04:38
Show Gist options
  • Save Xeroday/5551688 to your computer and use it in GitHub Desktop.
Save Xeroday/5551688 to your computer and use it in GitHub Desktop.
Hovering over the link shows one URL, but clicking on it sends you to another.
<script>
function showLink() {
document.getElementById("theLink").setAttribute("href","http://www.google.com"); //URL to show
}
function clickJack() {
document.getElementById("theLink").setAttribute("href","http://www.bing.com"); //URL that it actually goes to
}
</script>
<a id="theLink" href="#" onmouseover="showLink()" onmousedown="clickJack()">Click me</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment