Пропадают кнопки, при запуске скрипта
После запуска "старт" кнопки пропадают, как сделать чтобы они оставались:
<html> <head> <script type="text/javascript"> function color() { document.write("<br>" + 1); } function func() { id = setInterval('color()',100); } function off() { clearInterval(id); } </script> </head> <body > <input type='button' value='Старт' onclick='func()'> <input type='button' value='Стоп' onclick='off()'> </body> </html> заранее спасибо! |
например так
<html> <head> <script type="text/javascript"> function color() { document.getElementById("res").innerHTML = ("<br>" + 1); } function func() { id = setInterval('color()',100); } function off() { clearInterval(id); } </script> </head> <body > <input type='button' value='Старт' onclick='func()'> <input type='button' value='Стоп' onclick='off()'> <div id="res"></div> </body> </html> |
спасибо
|
Часовой пояс GMT +3, время: 00:26. |