Link to home
Start Free TrialLog in
Avatar of ambuli
ambuliFlag for United States of America

asked on

Jquery syntax question

Hi there,
What is the difference between the following two versions of checking if a radio button is checked.  The second version seems concise but is there any difference. Thanks.
if($("input[id='SelectorID']").is(":checked")){
}

AND

if($("#SelectorID").is(":checked"){
}

Open in new window

SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Addendum - above figures are for FireFox - in Chrome the times for B and C are switched C is faster than B and both are faster than their equivalents on FF BUT A is significantly slower on A (461 for the 1000 test)