Javascript examples for DOM HTML Element:Input Button
Update button text as you click it
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> var number = 1;// w w w . j av a2 s. c o m function IncreaseNumber() { document.getElementById('num').innerText = number; number++; } </script> </head> <body> <span id="num">0</span> <input type="button" onclick="IncreaseNumber()" value="Change Text"> </body> </html>