'key down' mouse event of the jQuery


 

'key down' mouse event of the jQuery

In this tutorial ,we will display ASCII value using "key down" method of jQuery.

In this tutorial ,we will display ASCII value using "key down" method of jQuery.

'key down' mouse event of the jQuery

In this tutorial ,we will display ASCII value using "key down" method of jQuery. In this example , a text box is given. When you type something or press any key it shows ASCII value of that key.

keydown.html

<!DOCTYPE html>
<html>
<head>
<script src="jquery-1.4.2.js"></script>
</head>
<body>

<input id="whichkey" value="type something">
<div id="log"></div>
<script>$('#whichkey').bind('keydown',function(e){
$('#log').html(e.type + ': ' + e.which );
}); </script>
</body>
</html>

OUTPUT

When we enter 'a' :

When we enter space bar it shows :

Download Source Code

Click here to see demo

Ads