+ 1
Calling input
how do I call input in JavaScript
5 Respostas
+ 3
<input type = "text" name = "" placeholder = "Enter your username" required
oninput="doSomething()"
>
#js
function doSomething(){
alert("hello");
}
+ 2
eeehh if you mean get input..use prompt()
var a=prompt("Enter you name");
0
HTML:
<input type = "text" name = "" placeholder = "Enter your username" required>
how do I call this in JavaScript
0
thanks
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