Javascript examples for DOM HTML Element:Input Button
Do Countdown repeatedly and change button text
<html lang="en"> <head> <title> Bla! </title> <script type="text/javascript"> var counter = 10;//w w w. jav a2s . c o m function CountDown(obj) { if (--counter < 0) counter = 10; obj.innerHTML = "counter=" + counter; } </script> </head> <body> <button onclick="CountDown(this)"> Click to countdown (10) </button> </body> </html>