Hi Jack,

Not silly at all.

You don't need to include more about the elements, but beginning with the tag name may result in faster selector performance than starting with the name attribute.

Please note, though, that your first expression should not have the spaces in between the selector parts. Also, you're missing a trailing single quote, and the double quotes aren't necessary. So instead of this:

$('input :radio [name="xxx"]:checked)

it should be this:

$('input:radio[name=xxx]:checked')

If I were using this in a script, I'd probably drop the :radio part. Since I wouldn't have a different type of input with the same name, there would be no reason to filter against that.

$('input[name=xxx]:checked)

Hope that helps.

--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Jul 14, 2008, at 3:39 AM, jack wrote:


Hi, all

For selector do I need to qualfy more about the elements I want to
select? For example:

$('input :radio [name="xxx"]:checked)

does it better than the following

$([name="xxx"]:checked)


Thank you in advance!


jack

Reply via email to