js 获取事件源
<script type="text/javascript" src="jm.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(window).keydown(function(event) { obj = event.target?event.target:event.srcElement; if(obj) { alert(obj.id); if(event.keyCode == 13) { alert('提交'); } } }); }); //更多详细信息:http://unixpapa.com/js/key.html </script>