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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:31:08+00:00 2026-05-27T05:31:08+00:00

I have an application containing a form with five input fields. When the user

  • 0

I have an application containing a form with five input fields. When the user clicks on an input field a tooltip should be displayed, which works fine. The problem comes when I try to remove the tooltip, which happens if the user clicks on another input field. Below is a piece of code from my application, and I hope it’s enough to understand how it works.

The arguments that are passed to “showTooltip()” are a DOM reference to the clicked input field, the text that is displayed in the tooltip, and a number (0-4) that is used to find the containing div that’s surrounding the clicked input field (all input fields are inside their own div).

The application works fine, but after I’ve clicked around a couple of times on the fields the following message is displayed in the console: “Node was not found – inputDiv.removeChild(tooltip). I’ve found out that the reason for this is that the function “hideTooltip()” is sometimes called twice, but I can’t find out the reason why this happens.

Any clues?

showTooltip: function(inputField, tooltipText, divNr){
    var container = document.getElementById('container');
    var inputDiv = container.getElementsByTagName('div');   
    var inputDiv = inputDiv[divNr];

    var tooltip = document.createElement('div');
    tooltip.className = "tooltip";

    var text = document.createTextNode(tooltipText);
    tooltip.appendChild(text);

    inputDiv.appendChild(tooltip);

    inputField.addEventListener('blur', function() { hideTooltip(inputField, inputDiv, tooltip, inputNode);});
},

hideTooltip: function(inputField, inputDiv, tooltip, nr){
    inputDiv.removeChild(tooltip);

    validateField(inputField);
}
  • 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-27T05:31:09+00:00Added an answer on May 27, 2026 at 5:31 am

    unbind is jquery function, so it will not work unless you are using jquery. You will need to use the removeEventListener function without jquery. If you do decide to use jquery, I would recommend the one (http://api.jquery.com/one/) function that executes an event only once per element. I am not sure if you will need to check to see if the event exists before you call removeEventListener.

    var blurEvent = function() { hideTooltip(inputField, inputDiv, tooltip, inputNode); };
    inputField.removeEventListener('blur', blurEvent);
    inputField.addEventListener('blur', blurEvent);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an application containing a lot of user controls that update frequently based
I have a Websphere Portal application containing several portlets for which I'm currently working
I have a web page containing a login form which loads via HTTP, but
I have a large web form application that I want to allow the user
I have a database table containing data for a submitted application form with a
I have an application containing a variety of view controllers linked together in different
We have a distributed application containing C++ and Java modules, interacting via CORBA. Are
I have a web application containing two web services, let's say PublicHello.asmx and RestrictedHello.asmx
I am working in C# and VS2008. I have a WPF application containing a
The Scenario I have a windows forms application containing a MAINFORM with a listbox

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.