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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:54:42+00:00 2026-05-20T16:54:42+00:00

I have an live event on all link or multiple selector on the page

  • 0

I have an live event on all link or multiple selector on the page and i have multiple selector i don’t want active the event. Normally, when the first live function is executed on all link, the e.preventDefault() is activate. But if one of the selector is in my exclude list, i want execute the link normally. I have tried this code :

$(selectorListA).live('click',function(e) {
    // stop all event
});

$(selectorListB).live('click',function(e) {
    e.preventDefault();
    // do action
});

I have tried this to :

$(selectorListA).not(selectorListB).live('click',function(e) {
    e.preventDefault();
    // do action
});

All of this solutions don’t work, the only way i have is this code, it work but in chrome an error is showed before the click event is execute, hmmm i’m not sure is good :

$(selectorListB).live('click',function(e) {
    die();
});

$(selectorListA).live('click',function(e) {
    e.preventDefault();
    // do action
});

I don’t know what i can take for execute all selectorListA with exclude all selectorListB. Can you help me please, thank you!

  • 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-20T16:54:43+00:00Added an answer on May 20, 2026 at 4:54 pm

    What is the error you get in Chrome? Seems that the problem is not with your selectors.

    Either way, something like this should work:

    $(selectorListA).live('click',function(e) {
        if ($(this).is(selectorListB)) }{
            // stuff for b group only
        }
    
        // stuff for both groups
    });
    

    The version using .not() won’t work because live attaches a document-level handler and uses the original selector to test whether the event should apply. So actually selecting and filtering before calling live won’t work as it would with click().

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

Sidebar

Related Questions

I have this js code: $(#startSearch).live(click, function(event) { $(input:checkbox[name='searchId']:checked).each(function() { var searchId = $(this).val();
i have the following block of code: $(#contact_container form, #contact_details form).live( submit, function(event) {
Possible Duplicate: Bind multiple events to jQuery 'live' method I have the following function:
I have the following: $('#menu a[href^=/C], #menu a[href^=/Test], #menu a[href^=/T]') .live('click', function (event) {
I have the following in jQuery mobile: <script type=text/javascript> $(#locate_results).live(pageinit, function(event) { $(#venues li
I have a jQuery event for all <a> tags set up like this $('a').live('click',
I have live data in a database i want to tweet data in real
I am loading content into a page with ajax that will have live click
I have a live rails website and I want to have a form with
I have run the following through JSLint: $(document).ready(function() { /* Add paragraph on page

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.