How to get press key "Enter" in form with no input or input text disable. I want to get input key "Enter" to make some code change but don't know how to do this.
Asked
Active
Viewed 38 times
0
-
3You're going to have to be a lot clearer than this ? – adeneo Oct 05 '16 at 09:02
-
Check this: http://stackoverflow.com/questions/905222/enter-key-press-event-in-javascript – Alekos Dordas Oct 05 '16 at 09:04
-
what do you mean by no input or input text disable? – Pirate Oct 05 '16 at 09:04
-
If you're not going to clarify the question, please delete it. – JJJ Oct 05 '16 at 10:01
1 Answers
-1
someFocusedElement.onkeypress = function (event) {
if (event.key=="Enter")
alert('You pressed Enter!')
}

Dimava
- 7,654
- 1
- 9
- 24