info343/minilabs/6/solution/minilab6-ex2.js

// minilab6-ex2.js
// Sample JavaScript solution for Mini-Lab 6: Timers
// (Partial solution through Exercise 2)
// INFO 343, Autumn 2012
// Morgan Doocy

// Attach click handler to #begin button when the document is ready.
$(document).ready(function() {
   $('#begin').click(countDownByOne);
});

// Decrement the number in #seconds by one.
function countDownByOne() {
   var seconds = $('#seconds').val();
   $('#seconds').val(seconds - 1);
}