Test input number event listener

In this example below you will see how to do a Test input number event listener with some HTML / CSS and Javascript

This awesome code was written by FarhanSharif, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright FarhanSharif ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>Test input number event listener</title>


  <input type="number" id="num">

<button value="button"></button>

    <script  src="js/index.js"></script>



/*Downloaded from https://www.codeseek.co/FarhanSharif/test-input-number-event-listener-zPpJEV */
window.onload = function() {
  var num = document.getElementById("num");
  num.addEventListener("input", function() {
    alert("num has changed");