<script>
$(document).ready(function() {
var t1=0
$(document).keydown(function(){
if(t1==0){
var my_time = new Date();
t1=my_time.getTime()
}
$('#d1').html("Starting of keydown for keycode : " +
event.which + " AT : " + t1 );
$('#d2').html("Still holding .... <br>.." );
});
$(document).keyup(function(){
var my_time = new Date();
t2=my_time.getTime()
var t=t2-t1;
$('#d2').html("Ending with keyup for keycode : " +
event.which + " AT :" + t2 +"<br> Duration hold: " + t + " Milli seconds" );
t1=0;
});
})
</script>
Most Popular JQuery Scripts | |
1 | Two dependant list boxes |
2 | Calendar with Date Selection |
3 | Data change by Slider |
4 | Show & Hide element |