documentFragment添加节点
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>documentFragment添加节点</title> 5 </head> 6 <body> 7 <ul></ul> 8 </body> 9 <script> 10 let documentFragment = document.createDocumentFragment(); 11 for(let i=0;i<100;i++){ 12 let ali = document.createElement('li'); 13 documentFragment.appendChild(ali); 14 } 15 document.body.appendChild( documentFragment) 16 </script> 17 </html>