ddolddolee82
04-21-2006, 08:24 PM
I am trying to use a DOM trick with images. Anyway, I wrote this short lines of codes to test it. This seems to work in internet explorer but it doesn't in firefox. Is there something wrong with it?
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>Untitled Document</title>
<script type='text/javascript'>
function original () {
document.getElementById('image').innerHTML = '<p>replaced</p>';
}
</script>
</head>
<body>
<span id='image'><p>replace this part</p></span>
<p><a href onclick='original()'>click</a></p>
</body>
</html>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>Untitled Document</title>
<script type='text/javascript'>
function original () {
document.getElementById('image').innerHTML = '<p>replaced</p>';
}
</script>
</head>
<body>
<span id='image'><p>replace this part</p></span>
<p><a href onclick='original()'>click</a></p>
</body>
</html>