mcmuney Posted August 19, 2009 Share Posted August 19, 2009 Is there a way to modify this script to work outside of a form? Working Link <form name="counter"><input type="text" size="8" name="d2"></form> <script> <!-- // var milisec=0 var seconds=30 document.counter.d2.value='30' function display(){ if (milisec<=0){ milisec=9 seconds-=1 } if (seconds<=-1){ milisec=0 seconds+=1 } else milisec-=1 document.counter.d2.value=seconds+"."+milisec setTimeout("display()",100) } display() --> </script> Quote Link to comment Share on other sites More sharing options...
ldb358 Posted August 19, 2009 Share Posted August 19, 2009 i thnk this shoud work: var time = document.getElementById("yourElement"); time.innerHtml = 30; //then later time.innerHtml = seconds+"."+milisec you can use this is a variety of elements linke div, span, ect. just put the elements id where it says yourElement Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.