Jquery Keydown Enter Example - Jquery

How to create keydown event in jquery?

Snippet Code

Rate this page :
  [ 0 votes]

Sample jquery code allows you to create an keydown event when keyboard key is pressed down. The jquery code given below is used to create an keydown event.

<script type='text/javascript'> $(document).ready(function(){ $("#target").keydown(function() { //alert("Keydown() handler!"); $("input").css("color", "green"); }); $("#target").keyup(function(){ $("input").css("color", "black"); }); }); </script> <input id="target" type="text" value="Welcome">


Ask Questions

Ask Question