[jQuery] Event delegation and accounting for children/descendants

[jQuery] Event delegation and accounting for children/descendants


I was reading a great post on learningjquery.com about event
delegation, and it gave an example of how to account for child/
descendants that might get clicked.
Here is the example show:
$(document).ready(function() {
$('table').click(function(event) {
var $thisCell, $tgt = $(event.target);
if ($tgt.is('td')) {
$thisCell = $tgt;
} else if ($tgt.parents('td').length) {
$thisCell = $tgt.parents('td:first');
}
// now do something with $thisCell
});
});
My question is, how do I do something with $thisCell? I must be
missing a step here, what is I wanted it to throw an alert?
Also, what is the :first doing in this situation? Say, I have a link
that has a few nested spans inside, how could I ignore the clicks on
those spans, and only register it as a click on the anchor?