How to Get $user_input from <button> in html and input that in form Or anything else ? | Sololearn: Learn to code for FREE!

+6

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

1/17/2019 4:01:59 AM

[SE]شبگرد

8 Answers

New Answer

+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>

+5

Mikael W-Dox, if you know how to from pHp and javascript then ypu probably know such task can be done by html

+4

Kelvin Paul no , i ask for html , i know java and php can do this .

+4

+4

Kelvin Paul ok thanks

+2

Did you mean using either php or JavaScript?

+2

Did you mean get user input using <input> tag with the help of button tag

+2

Please use JavaScript