// minilab6-ex3.js
// Sample JavaScript solution for Mini-Lab 6: Timers
// (Partial solution through Exercise 3)
// INFO 343, Autumn 2012
// Morgan Doocy
// Attach click handler to #begin button when the document is ready.
$(document).ready(function() {
$('#begin').click(/*[<ins>]*/startTimer/*[</ins>]*/);
});
/*[<ins>]*/// Begin the countdown timer.
function startTimer() {
setInterval(countDownByOne, 1000);
}/*[</ins>]*/
// Decrement the number in #seconds by one.
function countDownByOne() {
var seconds = $('#seconds').val();
$('#seconds').val(seconds - 1);
}