<ul id="a">
<li>5</li>
<li>sf</li>
<li>s</li>
</ul>
<script type="text/javascript" charset="UTF-8">
var ul = document.getElementById('a');
ul.onclick = function (e){
!e&&(e=event);
var target = e.srcElement||e.target;
if(target.tagName=='LI'){
alert(target.innerHTML)
}
}
</script>javascript
e.srcElement 當前點擊的事件源,iejava
e.target 火狐事件