Here's my problem. The code below is a simplified version to point out the weird error.
<html>
<head>
<script type = "text/javascript">
window.onload = function test()
{
body = document.getElementsByTagName('body')[0];
div = document.createElement('div');
div.id = 'div';
body.appendChild(div);
document.getElementById('div').innerHTML = "text";
if(document.getElementById('div').childNodes[0] == "text")
{
alert('true');
}else {
alert('false');
}
}
</script>
<style>
</style>
</head>
<body>
</body>
Why is it false!? Its virtually the SAME EXACT string. Is it the
.innerHTML part? Any answer relevant to this issue would help. It's late at night and I'm angry and confused.