Created
December 31, 2011 01:35
-
-
Save beizhang/1542390 to your computer and use it in GitHub Desktop.
removeNode for IE7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d = d || document.createElement('div'); | |
var id = n.id; | |
do { | |
do { | |
d.appendChild(n); | |
d.innerHTML = ''; | |
} while (n.parentNode); | |
} while (n = document.getElementById(id)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To be safe you should set the ID to something unique just in case there were somehow multiple elements with the same ID or other weird issues.