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 appear to be trying this with raw JavaScript:
while( root.firstChild ){ root.removeChild( root.firstChild ); }
jQuery will only slow you down here.