1<body>
2 <div id="poke"><button>click here</button></div>
3 <div id="counter">0</div>
4
5
6 <script type='text/javascript'>
7 var poke = document.getElementById('poke');
8 var cmp = document.getElementById('counter');
9 poke.addEventListener('click', myfonction)
10
11
12
13
14 //===========================================================
15 function myfonction() {
16 cmp.innerHTML = parseInt(cmp.innerHTML) +1;
17
18
19 }
20
21 </script>
22
23 </body>