Answers for "function increase a number by click javascript"

0

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>
Posted by: Guest on April-02-2020

Code answers related to "function increase a number by click javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language