+ 1

Calling input

how do I call input in JavaScript

21st May 2018, 2:09 PM
Alieldien
Alieldien - avatar
5 Answers
+ 3
<input type = "text" name = "" placeholder = "Enter your username" required oninput="doSomething()" > #js function doSomething(){ alert("hello"); }
21st May 2018, 2:24 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 2
eeehh if you mean get input..use prompt() var a=prompt("Enter you name");
21st May 2018, 2:16 PM
᠌᠌Code X
᠌᠌Code X - avatar
0
HTML: <input type = "text" name = "" placeholder = "Enter your username" required> how do I call this in JavaScript
21st May 2018, 2:22 PM
Alieldien
Alieldien - avatar
0
thanks
21st May 2018, 2:29 PM
Alieldien
Alieldien - avatar
0
HTML: <input type = "text" name = "" placeholder = "Enter your username" required oninput = "user()"> <button onclick = "welcome()" type = "submit" name = "" value = "login">login</button> JavaScript: function user (){} function welcome(){ alert ("welcome " + user());} he keeps saying for me welcome undefined
21st May 2018, 2:51 PM
Alieldien
Alieldien - avatar