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

  • Home
  • SEARCH
  • 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 1027507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:15:01+00:00 2026-05-16T12:15:01+00:00

I have an issue with jquery where elements are not found when the query

  • 0

I have an issue with jquery where elements are not found when the query string has ‘$’ char in them — is there a known issue? Unfortunately search engines make it so hard to searh for symbols in threads.

I have an html such as this:

<TD id="ctl00$m$g_cd3cd7fd_df51_4f95_9057_d98f0c1e1d60$ctl00$ctl00_5"
    class="MenuItem"
    onclick="setSelectedTab('ctl00$m$g_cd3cd7fd_df51_4f95_9057_d98f0c1e1d60$ctl00$ctl00_5');"
    tabsrowid="ctl00$m$g_cd3cd7fd_df51_4f95_9057_d98f0c1e1d60$ctl00$ctl00_"
    nohide="false">...

and my jscript goes something like:

function setSelectedTab(selection) {
    var ids = selection.split('/');
    for (var i = 0; i<ids.length; i++) {
        var item = $("#" + ids[i]);
        item.addClass("selected");
        $("#" + item.attr("tabsrowid")).show();
    }
}

While analyzing in firebug, I see that ‘item’ is an empty set. If I query $(‘.MenuItem’) for example, it correctly returns a result set with 25 matching items in the page; it appears like $(s) doesn’t work when s contains $ chars in it?

What’s the solution to it? Sorry if it a dumb question or well known issue — as I said I tried to google around, but unsuccessfully.

Note: It’s not an issue with javascript itself, or duplicate ids, or jquery not loaded, or anything like that. The function does get called onclick, and if I replace $(‘#’ + ids[i]) with document.getElementById(ids[i]), it does return the correct element.
fyi, the string passed to the function setSelectedTab usually contains a hierarchical path to the TD element; though in the example TD above, the ids.length is 1.

Thanks,
Raja.

  • 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-05-16T12:15:01+00:00Added an answer on May 16, 2026 at 12:15 pm

    Perhaps try escaping them with backslashes

    <TD id="ctl00\$m\$g_cd3cd7fd_df51_4f95_9057_d98f0c1e1d60\$ctl00\$ctl00_5"
        class="MenuItem"
        onclick="setSelectedTab('ctl00\$m\$g_cd3cd7fd_df51_4f95_9057_d98f0c1e1d60\$ctl00\$ctl00_5');"
        tabsrowid="ctl00\$m\$g_cd3cd7fd_df51_4f95_9057_d98f0c1e1d60\$ctl00\$ctl00_"
        nohide="false">...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 515k
  • Answers 515k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer http://weather.ou.edu/~apw/projects/stress/ Stress is a deliberately simple workload generator for POSIX… May 16, 2026 at 6:30 pm
  • Editorial Team
    Editorial Team added an answer If TrackBlob returns a string, you should be able to… May 16, 2026 at 6:30 pm
  • Editorial Team
    Editorial Team added an answer Not in a browser. The Rhino JavaScript platform gives you… May 16, 2026 at 6:30 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I know this issue has been touched on here but I have not found
I have nested ajax calls that are not working in ie7. They work fine
I have some jQuery code that runs fine until I add the jQuery UI
I'm using monorail, activerecord, and jquery. I have a form with a zip code
tl;dr = Anyone know how to apply chained classes for IE6 using jQuery or
I'm trying to submit a form which contains dynamic elements that were added to
In Theory I have a div (container) that when hovered over one of its
I'm trying to implement something like a photo carousel in jQuery. This carousel could
I am relatively new to implementing JQuery throughout an entire system, and I am
So I'm seeing some strange issues in ie8 with jquery, and assorted javascript files.

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.