How to Get $user_input from <button> in html and input that in form Or anything else ? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
+ 6

How to Get $user_input from <button> in html and input that in form Or anything else ?

17th Jan 2019, 4:01 AM
[SE]ōīō®ŕĮōĪōĮ
[SE]ōīō®ŕĮōĪōĮ - avatar
8 Respostas
+ 6
<!doctype html> <html> <head> <script> function getUser(){ alert(document.getElementById("user"). value); } </script> </head> <body> <Input id="user" type="text"/> <button onClick="getUser()">Alert</button> </body> </html>
17th Jan 2019, 6:35 AM
Kelvin Paul
Kelvin Paul - avatar
+ 5
Mikael W-Dox, if you know how to from pHp and javascript then ypu probably know such task can be done by html
18th Jan 2019, 4:36 PM
Sudarshan Rai
Sudarshan Rai - avatar
+ 4
Kelvin Paul no , i ask for html , i know java and php can do this .
17th Jan 2019, 6:29 AM
[SE]ōīō®ŕĮōĪōĮ
[SE]ōīō®ŕĮōĪōĮ - avatar
+ 4
yes
17th Jan 2019, 6:32 AM
[SE]ōīō®ŕĮōĪōĮ
[SE]ōīō®ŕĮōĪōĮ - avatar
+ 4
Kelvin Paul ok thanks
17th Jan 2019, 6:33 AM
[SE]ōīō®ŕĮōĪōĮ
[SE]ōīō®ŕĮōĪōĮ - avatar
+ 2
Did you mean using either php or JavaScript?
17th Jan 2019, 6:27 AM
Kelvin Paul
Kelvin Paul - avatar
+ 2
Did you mean get user input using <input> tag with the help of button tag
17th Jan 2019, 6:30 AM
Kelvin Paul
Kelvin Paul - avatar
+ 2
Please use JavaScript
17th Jan 2019, 6:32 AM
Kelvin Paul
Kelvin Paul - avatar