<!DOCTYPE html>id="myList"TeaMilkWater点击按钮创建 LI 元素。id="demo"onclick="myFunction()"尝试一下function myFunction(){var x = document.createElement("LI");var t = document.createTextNode("Coffee");x.appendChild(t);document.getElementById("myList").appendChild(x);}