<div id="num">hello</div>


<pre id="preTag">The null characters should be stripped out of the string above and it should have a length of 5. And the DOM thinks the length is...</pre>

<script>
    if (window.testRunner)
        testRunner.dumpAsText();

    var div = document.getElementById("num");
    var text = div.firstChild;    

    var string = text.length;
    if (text.length == 5)
        string += "!";
    else
        string += " :-(";

    var pre = document.getElementById("preTag");
    pre.appendChild(document.createTextNode(string));
</script>
