<script type="text/javascript">
window.onload = function(){
var i=1;
document.getElementById("a").onclick = function(){
var li = document.createElement("li");
li.innerHTML = i++;
document.getElementById("ul").appendChild(li);
return false;
};
}
</script>
<ul id="ul">
<li>0</li>
</ul>
<a id="a" href="#">Add</a>