hello again,
Im tring to stop this redirect with a button. this is the orginal script.
<script language="JavaScript" type="text/javascript">
var count =16
var redirect="example.php"
function countDown(){
if (count <=0){
window.location = redirect;
}else{
count--;
document.getElementById("timer").innerHTML = ""+count+" seconds."
setTimeout("countDown()", 3000)
}
}
</script>
Browser refresh in
<span id="timer">
<script>
countDown();
</script>
</span>
and this is what i have been tring that doesnt work
<html>
<body>
<p id="count"></p>
<button onclick="myStopFunction()">Stop</button>
<script language="JavaScript" type="text/javascript">
var count =16
var redirect="example.php"
function countDown(){
if (count <=0){
window.location = redirect;
}else{
count--;
document.getElementById("timer").innerHTML = ""+count+" seconds."
setTimeout("countDown()", 3000)
}
}
function myStopFunction()
{
clearTimeout(count);
}
</script>
Browser refresh in
<span id="timer">
<script>
countDown();
</script>
</span>
</body>
</html>
any help with this would be great
Thank you