Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

handling event changes

<button>Act-once button</button>
<script>
  let button = document.querySelector("button");
  function once() {
    console.log("Done.");
    button.removeEventListener("click", once);
  }
  button.addEventListener("click", once);
</script>
Source by eloquentjavascript.net #
 
PREVIOUS NEXT
Tagged: #handling #event
ADD COMMENT
Topic
Name
7+9 =