1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> <form name="form1"> 전화하는 시간은 <input type="text" size="10" name="formSec"> 입니다<br> 전화요금은 <input type="text" size="10" name="formWon"> 입니다 </form> <button type="button" onclick="document.bgColor='#ffff00'">배경색 변경</button> <script type="text/javascript"> var myCnt = 1; function func() { document.form1.formSec.value = myCnt + "초"; document.form1.formWon.value = ((Math.floor(myCnt/5) * 10) + 10) + "원"; myCnt = myCnt + 1; } setInterval("func()",100); </script> </body> </html> | cs |
Delay, sleep과 같은 기능
'IT Study > Web' 카테고리의 다른 글
[JavaScript] location 관련 함수 - back(), reload(), forward() (0) | 2018.08.06 |
---|---|
[JavaScript] location.href 기본 예제 (0) | 2018.08.06 |
[JavaScript] HTML 과 JavaScript 기본 예제 (0) | 2018.08.06 |
[JavaScript] Math 관련 예제 (0) | 2018.08.06 |
[JavaScript] toString, parseInt (0) | 2018.08.06 |