I am appending li in a ul using the following code:
li
ul
for (var i = 1; i <= len; i++) { li = document.createElement(\'li\');
You need to fetch the elements before removing them as the native DOM methods (most of them anyway) can't be passed in selector strings the same way jQuery's methods can.
var lis = root.getElementsByTagName("li"); for(var i = 0, il = lis.length;i