[jQuery] is accessing element by a class faster than accessing X element by ID
Hi,
I want to know if it first code is faster than the second (and why) :
1st try :
----------------------------------------
<div id="toto1" class="toto">....</div>...
<div id="toto2" class="toto">....</div>...
<div id="toto3" class="toto">....</div>...
$(".toto").hide();
----------------------------------------
2nd try :
----------------------------------------
<div id="toto1">....</div>...
<div id="toto2">....</div>...
<div id="toto3">....</div>...
$("#toto1").hide();
$("#toto2").hide();
$("#toto3").hide();
----------------------------------------
(in my code, there are more than 50 "toto")
Thanks for helping.