I am trying to begin a countdown timer when a button is clicked. I have searched and found a few different items, but nothing that seems to function.
I have different buttons throughout the domain that will set different times (IE: 120 seconds, 60 seconds, etc). The display is in the same spot on every page ( div
in the top right of the loaded page ) so I was wanting to use an external js scripts/timer.js
I can use <div id="timer"></div>
to place the timer.
My questions: How do I call the function to start the timer. What is a good suggested script for said timer when the amount of time can change and it has to carry over pages (I've been using $_SESSION['x']
to pass information between .php
<div class="headertopgab">
<div style="float: left; margin-left: 20px">
Galactic Credits:
<?php echo "Ç".$_SESSION['galacticCredits']; ?>
</div>
<div style="margin-left: 50px; float: left">
<?php echo "".$_SESSION['currentLocation']; ?>
</div>
<div style="float:right">
<div id="time">10</div> <!-- this is where I want the countdown-->
</div>
</div>