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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:22:14+00:00 2026-06-13T02:22:14+00:00

This is a partial code, not the full version. I have a highlighter that

  • 0

This is a partial code, not the full version.

I have a highlighter that highlights a specific html element when the mouse hovers.

I also have a click event and listener.

My problem is : the highlighter event/listener does not detach when using Internet Explorer v6 v7 v8 v9

What am I doing wrong?

This is how I attach the event and start the event listener:

if (document.body.addEventListener) {
                        //alert(11);
                        document.body.addEventListener('mousemove', handler, false);
                    } else if (document.body.attachEvent) {
                        //alert(12);
                        var ff=function(e) {
                            return handler(e || window.event);
                        };
                        //alert(ff);
                        document.body.attachEvent('onmousemove', ff);
                    } else {
                        //alert(13);
                        document.body.onmousemove = handler;
                    }

This is how I stop the onmousemove/mouse event/listener :

if (document.body.removeEventListener) {
                    document.body.removeEventListener('mousemove', handler, false);
                } else if (document.body.detachEvent) {
                    document.body.detachEvent('onmousemove', function(e) {
                        return handler(e || window.event);
                    });
                } else {
                    document.body.removeAttribute("onmousemove");
                }

This is how I stop the onclick/click event/listener:

if (document.body.removeEventListener) {
                    document.body.removeEventListener('click', ClosetAffairHighlighter.highlightClick, false);
                } else if (document.body.detachEvent) {
                    document.body.detachEvent('onclick', ClosetAffairHighlighter.highlightClick);
                } else {
                    document.body.removeAttribute("onclick");
                }
  • 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-13T02:22:15+00:00Added an answer on June 13, 2026 at 2:22 am

    base on this article, a cross-browser event handler can be :

    var EventUtil = {
        addHandler: function(element, type, handler) {
            if (element.addEventListener) {
                element.addEventListener(type, handler, false);
            } else if (element.attachEvent) {
                element.attachEvent("on" + type, handler);
            } else {
                element["on" + type] = handler;
            }
        },
        removeHandler: function(element, type, handler) {
            if (element.removeEventListener) {
                element.removeEventListener(type, handler, false);
            } else if (element.detachEvent) {
                element.detachEvent("on" + type, handler);
            } else {
                element["on" + type] = null;
            }
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a simplified partial version of my code to demonstrate the issue: function
I have a program that looks something like this: public partial class It {
I have a page that is setup like this public partial class _Default :
This partial code I hacked in to JamieMThomas's JQuery plugin that combines the Microsoft
I have a form partial that looks like this: <%= form_for(@pool) do |f| %>
With this code: public partial class Form1 : Form { private static readonly int
Here is my code: partial void OnisApprovedChanging(bool value) { this.dateApproved = DateTime.Now; } 'dateApproved'
I have this in my partial view: <tr> <% for (int currentDay = 0;
I have some IO code that reads a stream within a try..catch. It catches
I have a console application that references third party libraries whose source code I

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.