skip to main
|
skip to sidebar
Andrew's Blog
Sunday, August 8, 2010
Get event keycode in both Firefox and Internet Explorer
This solution should work in both IE and Firefox.
JS -
function getCharCode(event)
{
var charCode = (event.which) ? event.which : event.keyCode
;
// Might want to get the character representation of the Unicode keycode -
var character = String.fromCharCode(keycode);
}
HTML -
Just put an onkeypress="getCharCode(event)" event handeler in your input code (textarea, whatever)
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)
Blog Archive
►
2011
(1)
►
May
(1)
▼
2010
(8)
▼
August
(1)
Get event keycode in both Firefox and Internet Exp...
►
July
(1)
►
June
(1)
►
April
(1)
►
March
(2)
►
January
(2)
►
2009
(11)
►
September
(2)
►
August
(5)
►
April
(1)
►
March
(1)
►
January
(2)
►
2008
(5)
►
December
(1)
►
August
(2)
►
July
(1)
►
April
(1)
►
2007
(6)
►
June
(2)
►
May
(1)
►
April
(2)
►
February
(1)
►
2006
(3)
►
December
(3)
About Me
Name: Andrew
I am a complete nerd. I love computers and everything to do with them. When I'm not procrastinating, I'm either browsing the web or installing Linux.
View my complete profile