<!DOCTYPE html> 
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://www.softwhy.com/"
<title>Document</title>
<style type="text/css">ul{
list-style:none;
width:100px;
height:25px;
line-height:25px;
font-size:12px;
}</style>
<script type="text/javascript">function(){
var obox=document.getElementById("box");
var oshow=document.getElementById("show");
var lis=obox.getElementsByTagName("li");
for(var index=0;index<lis.length;index++){
lis[index].theIndex=index;
lis[index].onclick=function(){
oshow.innerHTML=this.theIndex;
lis[0].parentNode.removeChild(lis[this.theIndex]);
}
}
}
</script>
</head>
<body>
<div>当前元素的顺序:<span id="show"></span></div>
<ul id="box">
<li>元素一</li>
<li>元素二</li>
<li>元素三</li>
<li>元素四</li>
<li>元素五</li>
<li>元素六</li>
</ul>
</body>
</html>