Key number of pressed key using JQUERY

We can get the number of the key pressed by user by using event.which

This code we will use along with keydown event to collect the pressed key number.

Here is the syntax

<script>
$(document).ready(function() {

$(document).keydown(function(){
$("#t1").html('You  Pressed key No: ' + event.which);
});

})
</script>


  • Video Tutorial on keyboard Events


Event Reference DEMO of event.which Event

Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here .







    Most Popular JQuery Scripts

    1

    Two dependant list boxes

    2

    Calendar with Date Selection

    3

    Data change by Slider

    4

    Show & Hide element


    JQuery Video Tutorials




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer