<input onKeyDown="checkKey(event)" name="SearchData" type="text">
<script language="JavaScript" type="text/javascript">function checkKey(evt) { var evt = evt ? evt : (window.event ? window.event : null); //区分IE和FF来得到eventvar code = evt.which ? evt.which :evt.keyCode; //区分IE和FF来得到 event.keyCode 或 event.whichalert(code);}</script>