You are here: irt.org | FAQ | JavaScript | Date | Q917 [ previous next ]
Try:
<form name="timer"> <input type="text" value="" name="field"> </form> <script language="JavaScript"><!-- var counter = 15; function countDown() { document.timer.field.value = counter-- + ' seconds left'; if (counter != -1) setTimeout('countDown()',1000); else alert('You lose'); } countDown(); //--></script>