Can anyone speak to how the different browsers handle the following:
Picture an HTML document essentially rendering content of a static app with lots of data.
<div class="abundant_class">
<div class="abundant_class">
<div class="abundant_class"></div>
<div class="abundant_class"></div>
...
</div>
<div class="abundant_class">...</div>
<div class="abundant_class">...</div>
...
</div>
Imagine O(1000) such elements in the document.
What's the fastest way to assign a click event to all of these elements?
<div class="abundant_class" onclick="javascript:foo()">
$('.abundant_class').click(function(foo();));
$('div').click(function(){if ($(this).hasClass('abundant_class')){foo();}
- something else?
I'm wondering specifically how much memory and CPU these choices incur.
Thanks in advance.
Trevor Mills