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.
HTML

00:05

JS

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

        function update() {
            var myTime = $worked.html();
            var ss = myTime.split(":");
            var dt = new Date();
            dt.setHours(0);
            dt.setMinutes(ss[0]);
            dt.setSeconds(ss[1]);

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

            $worked.html(ts[1]+":"+ts[2]);
            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?

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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