Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
How can I use an array of values as a jQuery selector argument?

I would like to have an array of classes/IDs and then on a click function using jQuery pass each of those values to that function to exclude them from the event rather than have numerous :not calls as I currently have which works but is a bit ugly to me.

 var excludes = [
          '#seeMore',
          '#readMore',
          '#isiToTop',
          '.btn-cta--download',
          '.videoModalTrigger',
        ];

        $(
          "a[href]:not('#seeMore'):not('#readMore'):not('#isiToTop'):not('.btn-cta--download'):not('.videoModalTrigger')"
        ).click(function () {
          _siteNs.Utils.deleteCookie('5_Signs');
        });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

.not():

$("a[href]").not(excludes.join())
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!