copy change event to keyup

copy change event to keyup

Hi

I'm fairly new to jquery, I'm in a situation where I need to copy the onchange event handler to the onkeyup event handler for a select statement. Can anyone offer a way to do this using jquery?


  1. <html>
  2. <head>
  3. <title>onchange test case</title>

  4. <script src=https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js></script>
  5. </head>
  6. <body>
  7. <form>
  8. <select id="testonchange">
  9. <option>option1</option>
  10. <option>option2</option>
  11. <option>option3</option>
  12. </select>
  13. <button>bla</button>
  14. </form>
  15. <script>
  16. $("#testonchange").change(function ()
  17. {
  18. alert("onchange activated");
  19. });
  20. </script>
  21. </body>
  22. </html>