J
Janooo
Hi,
I am trying to understand why this code does not work as expected.
FF shows the message twice; IE doesn't show the message at all.
What would be the right way to get the message displayed only once?
Please, help, thanks...
Jano
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script language="javascript">
function test_of_innerhtml(){
document.getElementById('n1').innerHTML='<strong
onmouseout="javascript:alert(\'Hi\');">hi in</strong>';
}
</script>
</head>
<body>
<div id='n1' onmouseover="javascript:test_of_innerhtml();">hi</div>
<br />
<a
href="javascript:alert(document.getElementById('n1').innerHTML);">Show
innerHTML</a>
</body>
</html>
I am trying to understand why this code does not work as expected.
FF shows the message twice; IE doesn't show the message at all.
What would be the right way to get the message displayed only once?
Please, help, thanks...
Jano
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script language="javascript">
function test_of_innerhtml(){
document.getElementById('n1').innerHTML='<strong
onmouseout="javascript:alert(\'Hi\');">hi in</strong>';
}
</script>
</head>
<body>
<div id='n1' onmouseover="javascript:test_of_innerhtml();">hi</div>
<br />
<a
href="javascript:alert(document.getElementById('n1').innerHTML);">Show
innerHTML</a>
</body>
</html>