Every node has a parent ... if not then it cannot be removed. All functions in dom2.js are accessing the parent without checking.