JS - Event Handler - supported in all browser


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ---- HTML -----
  2. <input type="text" onKeyPress="SearchName(event)">
  3.  
  4. ---- JS -----
  5. <script type="text/javascript">
  6. function SearchName(e) {
  7. alert(e.keyCode);
  8. }
  9. </script>

Report this snippet


Comments


You need to login to view comments.