Home
HTML
HTML Forms
Tryit: HTML input elements
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h2>Text input fields</h2> <form> <label for="fname">First name:</label><br> <input type="text" id="fname" name="fname" value="John"><br> <label for="lname">Last name:</label><br> <input type="text" id="lname" name="lname" value="Doe"> </form> <p>Note that the form itself is not visible.</p> <p>Also note that the default width of text input fields is 20 characters.</p> </body> </html>