I want an alert box before 10 min in the countdown timer using javascript
<p>Code below is to show the timer for session expiry.I wanted to show alerts for the last 10 min and 5 min and 1 min before expiry. Tried many ways but was not successful.</p>

<pre><code>&lt;div id="timer"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
function countdown(minutes) {
    var seconds = 60;
    var mins = minutes

function tick() {

    var counter = document.getElementById("timer");
    var current_minutes = mins-1
    seconds--;

    counter.innerHTML = 'Remaining Time  for your session to expire is ' +
current_minutes.toString() + ":" + (seconds &lt; 10 ? "0" : "") +     String(seconds);
    if( seconds &gt; 0 ) {
        setTimeout(tick, 1000);
    } else {

        if(mins &gt; 1){

           // countdown(mins-1);   never reach “00? issue solved:Contributed    by Victor Streithorst
           setTimeout(function () { countdown(mins - 1); }, 1000);

        }

    }
}

    tick();
}
 var config = &lt;?php echo json_encode($time4) ?&gt;;
countdown(config);

&lt;/script&gt;
</code></pre>