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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:18:07+00:00 2026-05-26T17:18:07+00:00

I’m not sure how to describe this, but I’ll try with some basic code:

  • 0

I’m not sure how to describe this, but I’ll try with some basic code:

<input type="text" id="num" placeholder="eg: 55"/>

Let’s say we add some basic filtering code:

$('.num').keyUp(function(){
    this.value = parseInt(this.value);
});

This is what the end-developer does. Now let’s imagine the s/he also uses a form validation system of our design:

// ...
if(el.val()!=parseInt(el.val()))
    showError(el);
// ...

Let us presume our showError shows a tooltip only when the user hover over it:

function showError (el){
    el.css('border-color', 'red');
    el.mouseOver(function(){
        showErrorTooltip(this);
    });
}

That works fine, but what if the error has been fixed? With jQuery, you’d usually do:

removeError(el);

This function would remove some CSS stuff from the element in question, but, most importantly, it will also remove our mouseOver event like the one we added above:

function removeError(el){
    el.css('border-color': null); // default color
    el.unbind('mouseOver');
}

This works well until the end developer needs to do something flashy when the mouse hover over the element, by using jQuery’s mouseOver.

The problem is, my removeError function clears both my event as well as the developer’s event.

So, my final question is, how do I tag event callbacks so I can remove them selectively?


If the above didn’t seem to make sense, this is some pseudo-code on what the result might look like:

Something like:

var tag_a = $('#a').click(function(){ alert('test1'); });
var tag_b = $('#a').click(function(){ alert('test2'); });
$('#a').unbind(tag_a);
$('#a').click(); // shows test2 only
  • 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-26T17:18:08+00:00Added an answer on May 26, 2026 at 5:18 pm

    The mechanism you’re looking for is event namespacing: http://docs.jquery.com/Namespaced_Events

    Example in your case:

    el.bind('mouseOver.error', function() { ... })
    el.unbind('mouseOver.error') //does not remove other mouse over events
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have some data like this: 1 2 3 4 5 9 2 6
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I need to clean up various Word 'smart' characters in user input, including but
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.