innerHTML problem?

Martin Jordan fanti at spin.de
Tue Aug 31 14:42:32 BST 2004


hi there,

shouldn't document.getElementById( ... ).innerHTML grant access to the inner 
value of the html-tag and not to the whole itself?

=========
<html>
<head>
<script language="JavaScript">
function foo( )
{
  alert( document.getElementById( 'myId' ).innerHTML );
}
</script>
</head>
<body onLoad="foo( )">
<p id="myId">hello world</p>
</body>
</html>
=========

this shows an alertbox displaying the whole tag:

<p id="myId">hello world</p>

and not only the inner 'hello world' content.

tested with konqueror 3.3. (debian/unstable). i haven't had this behavior with 
older versions of konqueror.

http://fanti.staff.spin.de/jstest.html

regards,
martin

-- 
Martin Jordan - SPiN AG
fanti at spin.de





More information about the kfm-devel mailing list