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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:18:39+00:00 2026-06-03T21:18:39+00:00

Having a confusing issue with jQuery, basicly this code is added to 2 elements,

  • 0

Having a confusing issue with jQuery, basicly this code is added to 2 elements, and works fine, but I wan it to NOT work if you click a seperate element, I thought removing the class from these elements would stop them from workign, but even with no class they are still working… here some code.

$(".q1a1, .q1a3").click(function (e) {
e.preventDefault();
$(this).animate({ backgroundColor: "#db384b" }, 1000);
$(this).animate({ backgroundColor: "#0F437D" }, 2000);
$(this).children('.wrong').fadeIn(1000).fadeOut(2000);
});

^ I want this code to not work after the code below is clicked (if that makes sense)

$(".q1a2").click(function (e) {
e.preventDefault();
$(this).animate({ backgroundColor: "#00a6eb" }, 800);
$('.q1a2 .correct').show();
$('.q1a1, .q1a3 ').removeAttr("class");
});

Any ideas?

  • 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-03T21:18:42+00:00Added an answer on June 3, 2026 at 9:18 pm

    Removing the class will not help, as you have already attached the click event to the element.

    You should use unbind to remove

    $('.q1a1, .q1a3 ').unbind("click");
    

    http://api.jquery.com/unbind/

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

Sidebar

Related Questions

Hopefully this question is not to confusing, but I can help clear it up
I think that this is a permissions issue but I am not sure and
I am having a confusing issue -- for me at least, this may be
I am having some confusion with the new keyword,things work fine when I am
I have a rather confusing issue. I've recently picked up some code I wrote
I'm having a problem with a site created in Drupal 6 but not compatable
A client is having an issue running java2ws on some of their code, which
and thanks for the help. I am having a somewhat confusing issue with IE7
I'm a java newbie, and am having a very confusing issue with StackOverflow errors
All, On our website we are having issues with getting any jquery code to

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.