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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:04:16+00:00 2026-06-12T00:04:16+00:00

Along with a number of other a class elements, I’ve got a link with

  • 0

Along with a number of other a class elements, I’ve got a link with the markup

<a class="editLink" href="www.somelink.com"> Edit <\a>

And I want to select every a element using jQuery except those in this editLink class.

So I’ve used a.not(".editLink") for the jQuery selector which works fine. However I noticed that this also works when I do a.not("editLink") and a.not("#editLink")

It’s like the jQuery ignores the CSS passed as part of the not() method argument. The docs suggest it is necessary to pass the id/class CSS but from what I can tell it’s un-necessary.

Can anyone shed any light on this? Am I being stupid or is there some magic happening?

Thanks


Update – Okay I think I made an error with my syntax. I was doing:

$("p, a.not(".editLink")").click()...

When it should have been

$("p, a").not("a.editLink").click()...

So my bad. Interestingly though the original did select all the a element apart from those in the editLink class.

Thanks for your help 🙂

  • 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-12T00:04:17+00:00Added an answer on June 12, 2026 at 12:04 am

    It does require a selector string. It’s just treating "editLink" as a selector string that represents an element called <editLink>, which clearly your <a> elements are not.

    So, your code a.not("editLink") “works”… just not the way you expect it to: instead of filtering out those elements that don’t have a class with that name, it does nothing because none of the <a> elements are <editLink> elements. And, if none of your <a> elements have an ID with that name either, then the same goes for a.not("#editLink").

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

Sidebar

Related Questions

You are given all the prime factors of a number, along with their multiplicities
I've got a long list containing different numbers of elements which also can recur
I have a number of class, all with exactly the same interface. This interface
I have a number of data classes, which share an abstract base class so
I've added the Facebook like counter along with the other standard social media sharing
I am using PhoneGap along with JQuery Mobile and HTML elements for implementing my
I have a small file test.txt contains a Long number inside while another piece
As the title suggests I would like to convert a long number to the
I am parsing a long string of text and calculating the number of times
I'm trying to calculate the number of pairwise differences between a long list of

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.