Element.cleanWhitespace removes all empty text node children of an element. This is useful for situations where unwanted whitespace might interfere with DOM traversal.
Element.cleanWhitespace( element );
<ul id="list">
<li>One</li>
<li>Two</li>
</ul>
<script type="text/javascript">
Element.cleanWhitespace('list');
</script>
will convert the UL to look like:
<ul id="list"><li>One</li><li>Two</li></ul>
(Note that this is a a representation of the DOM in XHTML terms for easier understanding)
IE doesn’t create empty text nodes, except for  ’s and linebreaks after LI nodes.