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 .

<script>
$(document).ready(function() {
$(document).keyup(function(){
alert('hi');
});
})
</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>
Your Rating




Google+

Post Comment This is for short comments only. Use the forum for more discussions.







Most Popular JQuery Scripts

1

Two dependant list boxes

2

Calendar with Date Selection

3

Data change by Slider

4

Show & Hide element
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2018 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer