It doesn't match on partials unless you use special selector symbols.

 

The reason your element is matched is because the class "myDiv" on your div
matches the $(".myDiv") part of your selector.  It is not because of the
partial match.  When you do a comma delimited list as a selector, an element
matching anything in the list will be retrieved.  So your selector ".myDiv,
#my" would match any elements with the id "my" OR the class "myDiv".

 

If you just want to search for the id you'd do this:

$("#myID")

 

-- Josh

 

From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Peter Marino
Sent: Thursday, May 28, 2009 10:35 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] matching full names when querying

 

Hi jQuery people,

 

I just found out that jQuery can match on partials,.. is this correct?

and if so how do I make it match on the whole text.

 

i.e.

 

<div id="myID" class="myDiv" />

 

doing a $(".myDiv, #my") will actually match the above tag! is this correct?

if so how do I force it to match the whole "myID" instead of partials?

 

regards,

Peter

-- 
Power Tumbling - http://www.powertumbling.dk
OSG-Help - http://osghelp.com

Reply via email to