1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<html> <head> <script> function init() { var y = document.getElementById("tt"); var z = y.firstChild; y.removeChild(z); z.text; } window.addEventListener("load", init); </script> </head> <body> <div id="tt"><a href="http://www.mozilla.org">Foo</a></div> </body> </html>