2019独角兽企业重金招聘Python工程师标准>>>
<script type="text/javascript"> function addItem() {var myitem = document.getElementById("ItemToAdd").value;var mylistItems = document.getElementById("mylist");var newP = document.createElement("li");var textNode = document.createTextNode(myitem);newP.appendChild(textNode);document.getElementById("mylist").appendChild(newP);return false; } </script> <form οnsubmit="return addItem()" action="#"> <span>Grocery Items:</span> <input type="text" id="ItemToAdd" value="Milk" /> <input type="button" value="Add" οnclick="addItem()" /> </form> <span>Grocery List:</span> <ol id="mylist"></ol>