web hosting and development forums
Web Design and Development Forums Archive


Index - JavaScript forum

onKeyPress


Post reply

Hey all I'm kinda new to javascript... i have: <body onLoad="initB()">... how can i add onKeyPress="microsoftKeyPress()" to it?
You can just add onkeypress="microsoftKeyPress()" in the tag, same as the other. But note that they're onload and onkeypress, not the capitalised versions.
HTML is case insensitive, it doesn't matter.
Roombor, how do i add it? is there a , or a ; ? <body onLoad="initB()" onkeypress="microsoftKeyPress()" > Or How?
Well the onkeypress event goes on the object you want the key press to occur on. I don't think you can just set an onkeypress event for the body. (I might be wrong)
You can,but the keypress has to occur on an element that can trigger one. Then I think it bubbles
Ok. I stand corrected.
Thx, guys




Dubai Forum | Paris Forum | Webmaster Forum | Vegan Forum | Brisbane Forum | 3D Forum | Jobs in Dubai | Jobs in London | London UK Classifieds
Archive script by RedHo.com