Sunday, July 31, 2011

Get keyCode on keypress in javascript


Add this javascript code:



<script>

function getKey(e)

{

//for internet fix

var k = (window.event) ? event.keyCode : e.keyCode;

alert(k);

}

</script>





html code:



<input type="text" onkeypress="getKey(event)" />

Post a Comment

Find a cool free stuff everyday

Giveaway of the Day

Hiren Bharadwa's Posts

DotNetJalps