Say I want to select an element such as
<div class="my class">InnerHTML</div>
While this may be done easily using CSS selectors with [class="my class"], gwtquery has a difference in the sense that it doesn't take the quotation marks in the input. It only accepts values like [attribute=attributevalue].
When I applied the same selector in GQuery with the space in between, it returned no matches. I have a feeling that this might be because of some incorrect parsing in the library for such cases. Is this so?
If so, is there any other way I might select these elements using GQuery?
It works for me (at least with gwtquery-1.1.0 and gwt 2.4.0)
returns a match for
<div class="my class"/>.However, with the
classattribute, it's generally better to use the~=selector instead, because<div class="my class"/>and<div class="class my"/>should usually be treated as equivalent.So I would suggest using
This will also select something like
<div class="my class special"/>, which is usually desirable.