I am using this simple script to cause text to blink. My only problem is that I cannot get it to stop with a button.
Here is the code – might make more sense looking at it.
<script language=”javascript”>
function blinkText1() {
document.getElementsByTagName(‘div’).item(0).style.visibility = “hidden”; setTimeout(“blinkText2()”, 1000)
}
function blinkText2() {
document.getElementsByTagName(‘div’).item(0).style.visibility = “visible”; setTimeout(“blinkText1()”, 1000)
}
function stopBlink() {
//what can I put here to cause the “loop” to stop?
}
</script>
</head>
<body>
<!– Item 0 –>
<div style=”visibility: visible”>
<center><h1>HEADING</h1></center>
</div>
<center><input type=”button” value=”Blink Text” onclick=”blinkText1()”></center><p>
<center><input type=”button” value=”Stop” onclick=”stopBlink()”></center>
</body>
I appreciate any help.
Thank you.