Forum Moderators: open
There is probably a more efficient way, but this will work.
NOTE: for( int x = 0; x < 10; ++x ) won't work because 10 would be reached a lot quicker than in 10 seconds.
One more question on a different idea using javascript. Is there a way to make it so that when you click a button (not hold down), it starts a timer counting down from 10, and when the timer hits 0, a link appears below (that can direct the user to another page). Or, alternativly, a link is already on the page, and just can't be used till the timer hits 0. Either of these will work, just looking for the easiest way to do it though.
Is there a way to make it so that when you click a button (not hold down), it starts a timer counting down from 10, and when the timer hits 0, a link appears below (that can direct the user to another page).
Yes, set the link to display:none or visibility:hidden then use setTimeout onclick in the button to show the link.
[w3schools.com...]
function showLink(){
setTimeout('document.getElementById("link").style.display="inline"',10000)
}<input type="button" value="showLink()" onclick="showLink()">
<a href="#" style="display:none" id="link">link</a>