In HTML--action on events other than mouse click?
I'm familliar with VB.Net, but HTML is driving me crazy. How can you have an event other than a mouse click? Speciafilly, I want to hyperlink without haveing to click on hyperlinked text--I want to link that event to a series of key strokes. Please help!
In HTML--action on events other than mouse click?palace theatreThe following code would cause your page to load yahoo whenever the 'a' key was pressed. There are functions that allow you to detect shift, alt, and control keys being held, so this could be modified to respond to ctrl-a instead. Also, the javascript could be changed further to record the keypresses as they come in, and check against a list of keywords / locations to move to, say only do the forward when they type in 'yahoo'.
Please Note I have added whitespace for readability, you'll probably get errors unless you mash it all onto one line. (At least the code between the first double-quote (") and the last one). Also, this code (probably) only works in IE, it would take more modification to get it to run in Netscape / Firefox / Opera / Safari. But at least this should get you started.
<script type="text/javascript">
document.onkeypress = new Function("
var keynum;
var keychar;
More Related Questions and Answers ...
The information post by website user , we not guarantee correctness.
