题解 | #JS动态创建节点#
JS动态创建节点
https://www.nowcoder.com/practice/144422bbf3044e8c8429a88588857c8b
function createLi(array){ // 补全代码 let len = array.length; let html = ""; for(var i =0;i<len;i++){ html += `<li>${array[i]}</li>`; } document.getElementsByTagName("ul")[0].innerHTML=html; }