I have a simple form that I'm using to learn something about HTML and
JavaScript.
Can I associate a button on the form with a keyboard key so that when
the user presses the keyboard key the form thinks the button has been
clicked?
Background:
I'm learning HTML and JavaScript. We did a simple JavaScript that had
a button that would add the numbers in two input fields.
I then thought it would be nice to change the form (and the
JavaScript) to make a "real" calculator.http://fmechess.org/demo/
calculator.html
What I would like to do is to make the calculator sensitive to normal
presses of the keyboard keys, so that instead of clicking on the
buttons to enter a calcualtion, the user can simply type on the
keyboard. Is this possible?
Thanks.
PS. I hope this is the right ng to ask in, I got "booted" out of the
HTML ng for asking in there. :)
JavaScript.
Can I associate a button on the form with a keyboard key so that when
the user presses the keyboard key the form thinks the button has been
clicked?
Background:
I'm learning HTML and JavaScript. We did a simple JavaScript that had
a button that would add the numbers in two input fields.
I then thought it would be nice to change the form (and the
JavaScript) to make a "real" calculator.http://fmechess.org/demo/
calculator.html
What I would like to do is to make the calculator sensitive to normal
presses of the keyboard keys, so that instead of clicking on the
buttons to enter a calcualtion, the user can simply type on the
keyboard. Is this possible?
Thanks.
PS. I hope this is the right ng to ask in, I got "booted" out of the
HTML ng for asking in there. :)
Comment