php/js – Triggering a button when my timer is set to 00:00

I have found a js fiddle code that works just fine here it is.



$(document).ready(function (e) {
        var $worked = $("#worked");

        function update() {
            var myTime = $worked.html();
            var ss = myTime.split(":");
            var dt = new Date();

            var dt2 = new Date(dt.valueOf() - 1000);
            var temp = dt2.toTimeString().split(" ");
            var ts = temp[0].split(":");

            setTimeout(update, 1000);

        setTimeout(update, 0000);

Side-ops problem: When it reaches 0, it resets to 59:59 but doesn’t matter for now.

How can I trigger this <input type="submit" name="submit" value="Submit Test" onclick ="return show_confirm();"> to be submitted/clicked when the timer reaches 0?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s