Do I need to somehow escape a space when using jquery to select with contains/find?
I am mocking this up so pardon the typos... If I have a SELECT tag that has some options
<select title="animals">
<option value="Dog Black">Dog Black</option>
<option value="Cat Black">Cat Black</option>
<option value="Dog Brown">Dog Brown</option>
</select>
I am trying to find the options in this select using jquery. but it appears that the "find" method or "contains" function fails when the value being passed to search for contains a space. For example:
The following returns a size of 2:
$('*[title="animals"]').find("option:contains('Dog')").size()
But this returns 0 whre I would expect 2 as well:
$('*[title="animals"]').find("option:contains('Dog B')").size()
My guess is that this has something to do with the selector and it is looking for a child element with "B" or something but Im not really sure.