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 1102399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:10:49+00:00 2026-05-17T01:10:49+00:00

the code: if (!($.browser.msie && $.browser.version.substr(0, 1) == ‘5’)){ $(‘ul a span’, ‘#menu’.not(‘{Developers}’)).css(‘color’, ‘rgb(210,210,210)’).hover(

  • 0

the code:

 if (!($.browser.msie && $.browser.version.substr(0, 1) == '5')){
        $('ul a span', '#menu'.not('{Developers}')).css('color', 'rgb(210,210,210)').hover(
            function(){ $(this).animate({color: 'rgb(255,255,255)'}, 500); },
            function(){ $(this).animate({color: 'rgb(210,210,210)'}, 200); }
        );
  }

Does this look like correct syntax? It’s working, however it’s throwing the error that .not is not a function. I’m calling this function in a menu.js that my main page is loading. It’s not in a document ready, and it is working, other than the error. If it weren’t working, I’d say my core jq library wasn’t loading first, but it is. Help is appreciated! Note, :not does not work, so please don’t suggest I use that. Thanks!

  • 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-17T01:10:50+00:00Added an answer on May 17, 2026 at 1:10 am

    If you mean to be using the jQuery function .not, you need to call it on a jQuery object (currently you’re trying to call it on a string). Here’ an example:

    $('ul a span', '#menu').not('{Developers}').css
                          ^--- changes here ---^
    

    If you really mean selector as in your title, then it’s :not, not .not (reference), and it would need to be part of the selector string. But you said later in your question that you tried :not and it didn’t work (I wasn’t sure where or how you tried :not, though).

    I think there’s another problem with that code, because both .not and :not expect a selector (.not also allows an element/jQuery instance or function), and the selector '{Developers}' is invalid.

    From your comment that it’s working other than the exception, I can only surmise that something else is changing the background on the elements, because the code as quoted will fail (throw an exception, that is barring your having added a not function to String.prototype), and won’t enter the $ function at all, much less get to the css part of it.

    If your goal is to color the background of the spans matching the selector ul a span under the element with the ID menu but not the span containing the text “{Developers}”, you need to use the :contains pseudo-class (taken out of CSS3 but jQuery supports it):

    $("#menu ul a span:not(:contains('{Developers}'))").css(...
    

    Live example

    If you prefer the form that passes #menu as a context parameter instead:

    $("ul a span", "#menu").not(":contains('{Developers}')").css(...
    

    Live example …but jQuery will handle them both efficiently.

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

Sidebar

Related Questions

I am trying to detect browser using following code, if ($.browser.msie && parseInt($.browser.version) >=
I am using the following code: ieLessThan8OptionDisable = function() { if ($.browser.msie && parseFloat($.browser.version)
Source Code: if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && parseInt($.browser.version, 10)<7) Edited - sorry, posted wrong
The below code is not changing the javascript source: if($.browser.msie){ var new_scr=document.createElement('script'); new_scr.src=http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js; document.getElementsByTagName('head')[0].appendChild(new_scr);
How to make this css code cross browser compatible using jquery. this code only
I'm trying to figure out how to use Emacs Code Browser (ECB) and one
i was wondering what would be the best way to code a browser plugin
In my asp.net mvc where to put code to expire browser session when server
Is it in general very hard to port JavaScript code to another browser platform?
I need directions on how to start the android browser through code . Thanks

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.