<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
window.onload = function(){
var ul1 = document.getElementById("ul1");
document.getElementById("add").onclick = function(){
var textnode = document.createTextNode("深圳");
var addli = document.createElement("li");
addli.appendChild(textnode);
ul1.appendChild(addli);
}
};
</script>
</head>
<body>
<input type="button" value="添加" id="add"/>
<ul id="ul1">
<li>北京</li>
<li>上海</li>
<li>广州</li>
</ul>
</body>
</html>