
Originally Posted by
Teron
and when I'm moving the mouse on the span, the result is like this:
sdsd aaaa ewewe 121212121212121212121
You're re-writing the entire body, which is triggering mouseout then mouseover events. You need to isolate the involved elements:
Code:
<html>
<head>
<script type="text/javascript">
function wr( elem )
{
document.getElementById('theContent').innerHTML+=1;
}
function wr2(elem)
{
document.getElementById('theContent').innerHTML+=2;
}
</script>
</head>
<body>
sdsd
<span onmouseover="wr()" onmouseout="wr2()" id='tex'>aaaa</span>
<div id='theContent'></div>
</body>
</html>
Bookmarks