Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7990221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:56:41+00:00 2026-06-04T12:56:41+00:00

Say I want to select an element such as <div class=my class>InnerHTML</div> While this

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:56:42+00:00Added an answer on June 4, 2026 at 12:56 pm

    It works for me (at least with gwtquery-1.1.0 and gwt 2.4.0)

    GQuery myClassDivs = $("div[class=\"my class\"]");
    

    returns a match for <div class="my class"/>.


    However, with the class attribute, 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

    GQuery myClassDivs = $("div[class~=my][class~=class]");
    

    This will also select something like <div class="my class special"/>, which is usually desirable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I want to define that an URI such as: myapp://path/to/what/i/want?d=This%20is%20a%20test must be handled
Say I have y distinct values and I want to select x of them
I want to select a value based on different column in SQL Server, say
How do I do the price conversion within this LINQ select? Let's say I
Using Javascript I have been able to select an image element (an HTMLImageElement object,
Say if I have an array and I want to check if an element
Here is a problem: i need to select elements on page by css class,
I'm pretty new to using CSS beyond applying directly to each element. I'd like
i have 6 element and i want to select the 5th element (with jQuery)
Ok lets say I have div with form elements inside of it. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.