I want to apply a click() event to all of the links on a page when the href of that link points to a file with a specific extension. The list of applicable extensions is hovering around 30 and may grow a bit in the future (but will never be more than 100).
My first inclination is to structure the event binding like so:
$("a[href$=avi],
a[href$=ppt],
a[href$=rtf],
// ...snip a bunch more of these....
a[href$=pdf],
a[href$=xml]").click(function() {
// Do something
});
Is this crazy?