Keyup Event using JQUERY

Keyup event is triggered when a pressed key is lifted up or released.
This event is triggered for all the keys

Here is the syntax
$("element").keyup(function(){
.....
})
Here is the code to trigger events on keyup. Here is the code .
  • Video Tutorial on keyboard Events


<script>
$(document).ready(function() {
$(document).keyup(function(){
alert('hi');
});
})
</script>
DEMO of keyup Event
Script showing keycode with keyup() event
<script>
$(document).ready(function() {
$(document).keyup(function(){
//alert('hi');
$('#d1').html("Event : keyup() , pressed key : "+event.which);
});
})
</script>

Textarea counter

We will use keyup function of a textarea so on adding of any text we will count the length of the string and then display the length inside another div layer.

Here is the code
<script>
$(document).ready(function() {
$("#d1").keyup(function(){
var str_length = $("#d1").val().length;
$('#d2').html(str_length);
});
})
</script>
Event Reference DEMO of counting number of chars entered inside textarea
keypress() keydown()

Tutorial ( Video ) on textarea counter
Application : Duration of holding the key Application : Password validation using Keyup() 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-2021 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer