Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

handling event changes

<a href="https://developer.mozilla.org/">MDN</a>
<script>
  let link = document.querySelector("a");
  link.addEventListener("click", event => {
    console.log("Nope.");
    event.preventDefault();
  });
</script>
Source by eloquentjavascript.net #
 
PREVIOUS NEXT
Tagged: #handling #event
ADD COMMENT
Topic
Name
8+3 =