Forum Moderators: open
Now I want to remove it dynamically.
setting this in Firefox (and everything but IE) works as expected:
obj.onmousemove='';
on IE, no dice, still fires.
Tried =null;
Tried =function(){}
Nada.
Please don't tell me I have to set a variable and if/then around it!?!
Thanks for any ideas!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<style type="text/css">
#testarea {
height: 200px;
width: 200px;
background: #c00;
}
</style>
<script type="text/javascript">
function foo() {
alert('hello');
}
function bar() {
document.getElementById('testarea').onmousemove = null;
}
</script>
<title>Untitled</title>
</head>
<body>
<div id="testarea" onmousemove="foo();"></div>
<input type="button" value="Remove onmousemove handler" onclick="bar();">
</body>
</html>