increment number in javascript html code example

Example: function increase a number by click javascript

<body>
    <div id="poke"><button>click here</button></div>
    <div id="counter">0</div>


    <script type='text/javascript'>
    var poke = document.getElementById('poke');
    var cmp = document.getElementById('counter');
    poke.addEventListener('click', myfonction)




    //===========================================================
    function myfonction() {
      cmp.innerHTML = parseInt(cmp.innerHTML) +1;


    }

    </script>

  </body>