Home Tutorial Jquery 'key down' mouse event of the jQuery

 
 

Share on Google+Share on Google+
'key down' mouse event of the jQuery
Posted on: August 9, 2010 at 12:00 AM
Advertisement
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

Advertisement

Related Tags for 'key down' mouse event of the jQuery:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: August 9, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com