>> Your jQuery attaches the event handler to every link in the document
The second method does so yes. The first method of attaching click event handlers to hyperlinks does not. I was attempting to show different methods for achieving a similar effect. However I understand where you are coming from on this and agree it is very inefficient.
>> Also, you've used the
$('#box_' + ... )
I agree it is fairly poor, however I didn't see the harm for this example.
>>it is better practice (and faster) to do
$('div#someID')
I didn't realise there was a performance benefit to that. I've seen official examples that include and exclude that step. I do so love conformity. Cheers for the heads up though.
>> I posted a short bit of jQuery above that should do what the OP is trying to do, in less than 10 lines of code.
True, I did notice your .toggle() event. There is always more than one way to skin a cat though.
>> Your discussion of graceful degradation is spot on. I tend to be in the "progressive enhancement" crowd, but it is realyl two ways of saying the same thing.
Haha, yeah. I'm becoming more and more of a fan of safe degradation. Come across a fair number of sites that don't degrade nicely and render the majority of the site useless.
>> Also, I've not seen you around - welcome to KS!
Thanks.