如何用javascript编写html
我需要用javascript编写一个html和css草稿bord如何用javascript编写html,javascript,dom,Javascript,Dom,我需要用javascript编写一个html和css草稿bord //I tried document.write() //and document.(my element).innerHTML 但我还需要另外一种方法 请提供帮助您可以将child附加到DOM元素中,如列表,例如: var node = document.createElement("LI"); // Create a <li> node var textnode = docume
//I tried
document.write()
//and
document.(my element).innerHTML
但我还需要另外一种方法
请提供帮助您可以将child附加到DOM元素中,如列表,例如:
var node = document.createElement("LI"); // Create a <li> node
var textnode = document.createTextNode("Water"); // Create a text node
node.appendChild(textnode); // Append the text to <li>
document.getElementById("myList").appendChild(node); // Append <li> to <ul> with id="myList"
检查我们完全不知道你的意思。请编辑您的问题并仔细解释。