Wikia

How To Wiki

How to create a webpage that changes by pressing keyboard keys with JavaScript

1,794pages on
this wiki
Talk0

You can use the following script:

<SCRIPT language=JavaScript> 
document.onkeypress=j;
function j(){
{if(event.keyCode==13)document.onkeypress=40}
{if(event.keyCode==97)window.location="URL"}
.
.
.
}
</SCRIPT>

How to use it...

keyCode defines the key that you press.

1
2
3
4
27 
38 arrow up
40 arrow down
37 arrow left
39 arrow right
97
98 : b

External LinksEdit

Around Wikia's network

Random Wiki