function pseudoHitMe() { alert("Ouch!"); } hit me" /> How To Have An Element Invoke A JavaScript On Selection, Instead Of Going To A New URL? function pseudoHitMe() { alert("Ouch!"); } hit me" /> function pseudoHitMe() { alert("Ouch!"); } hit me" /> hit me", "image": { "@type": "ImageObject", "url": "https://www.rendc.org/cdn/main_article.gif", "width": 1220, "height": 526 }, "author": { "@type": "Person", "name": "RENDC" }, "publisher": { "@type": "Organization", "logo": { "@type": "ImageObject", "url": "https://www.rendc.org/cdn/logo/rendc.gif", "width": 150, "height": 150 }, "name": "RENDC.ORG" } }
Answers

Question and Answer:

  Home  JavaScript

⟩ How to have an element invoke a JavaScript on selection, instead of going to a new URL?

<script type="text/javascript">

function pseudoHitMe() {

alert("Ouch!");

}

</script>

<a href="javascript:pseudoHitMe()">hit me</a>

 199 views

More Questions for you: