jquery/javascript: function(e){…. what is e? why is it needed? what does it actually do/accomplish?

Using e is just a short for event. You can pass any variable name you desire.

// would work just the same
$('#myTable').click(function(anyothername) {
    var clicked = $(anyothername.target);
});

You can check out more on jQuery’s handling of events.

Leave a Comment