0

var myNum = 0;
// a callback can be an anonymous function
$('#button').click(function() {
    $('#count').text(++myNum);
});

function youClicked() {
    myNum += 2;
    $('#count').text(myNum);
}

// or it can be a named function
$('#two').click(youClicked);