0

How do you get user input in web?

User input as in: when the a key is pressed do something.

30th Jun 2017, 8:36 PM
Joshua
Joshua - avatar
2 Answers
+ 14
onkeypress = function(e) { //e.keyCode..... };
30th Jun 2017, 8:37 PM
Valen.H. ~
Valen.H. ~ - avatar
0
Events. https://www.w3schools.com/js/js_events.asp https://www.w3schools.com/js/js_htmldom_events.asp https://www.w3schools.com/js/js_events_examples.asp If you use a framework for JS, like jQuery or Angular, it's insanely easier to work with. I know I'm going to get yelled at for this, but vanilla JS is just... ewww. :D It's great to know it, but it has been made much better through those other frameworks.
30th Jun 2017, 8:38 PM
AgentSmith