<!DOCTYPE html>
<html>
<body>
<ul id="myList"><li>Coffee</li><li>Tea</li></ul>
<p id="demo">������ť���б����һ����Ŀ��</p>
<button onclick="myFunction()">��һ��</button>
<script>
function myFunction()
{var newItem=document.createElement("LI")var textnode=document.createTextNode("Water")newItem.appendChild(textnode)
var list=document.getElementById("myList")list.insertBefore(newItem,list.childNodes[0]);
}
</script>
<p><b>ע�ͣ�</b><br>�����봴��һ�� LI �ڵ㣬<br>Ȼ��һ���ı��ڵ㣬<br>Ȼ������� LI �ڵ����ı��ڵ㡣<br>������б��е����ӽڵ�֮ǰ����� LI �ڵ㡣</p>
</body>
</html>