redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers
Wednesday 12 December 2018 22:18

Ask your IT question here

onKeyPress



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> JavaScript forum
View previous topic :: View next topic  
Author Message
Jackil
Enthusiastic Coder


Joined: 24 May 2006
Posts: 97
Hey all
I'm kinda new to javascript... i have: <body onLoad="initB()">... how can i add onKeyPress="microsoftKeyPress()" to it?

Reply with quote
 
Roombor
Enthusiastic Coder


Joined: 02 Jun 2006
Posts: 111
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.

Reply with quote
 
BigDaddy
Enthusiastic Coder


Joined: 26 May 2006
Posts: 147
HTML is case insensitive, it doesn't matter.
Reply with quote
 
Jackil
Enthusiastic Coder


Joined: 24 May 2006
Posts: 97
Roombor, how do i add it? is there a , or a ; ?
<body onLoad="initB()" onkeypress="microsoftKeyPress()" >
Or
How?

Reply with quote
 
Roombor
Enthusiastic Coder


Joined: 02 Jun 2006
Posts: 111
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)

Reply with quote
 
kadamat
Enthusiastic Coder


Joined: 01 Jun 2006
Posts: 88
You can,but the keypress has to occur on an element that can trigger one. Then I think it bubbles
Reply with quote
 
Roombor
Enthusiastic Coder


Joined: 02 Jun 2006
Posts: 111
Ok. I stand corrected.
Reply with quote
 
Jackil
Enthusiastic Coder


Joined: 24 May 2006
Posts: 97
Thx, guys
Reply with quote
 
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> JavaScript forum


Dubai Forums - Expat Help | Vegan Forum | Java Programming | 3d Design Resources | 3d Forum | 3D Jobs | 3D Textures | Paris Forum | Europe Forum
Dubai Classifieds | Dubai Property | Jobs in Dubai | Free London Classifieds | Jobs in London UK

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

© 2018 RedHo