$(\'#myTable\').click(function(e) {
var clicked = $(e.target);
clicked.css(\'background\', \'red\');
});
Can someone explain this to me, an
It's the formal parameter for the function. jQuery will pass in an event object when the function is called. This is used to determine the target. As noted in the documentation, jQuery will always pass an event object even when the browser (e.g. IE) doesn't.
In this case, the target tells you which element was originally clicked.