Adding a Text Field to a Form

A text field is used to enter text in the text box, which is used to send the data to the Web server. You can used the <input type=”text”> tag to add a text field to a form.

Let’s do the following steps to add a text field to a form:


<!DOCTYPE html>
<html>
<head>
    <title> Adding Text Field</title>
</head>
<body>
    <form action=””>
        First name: <input type=”text” name=”firstname” size=”30” > <br/>
        Last name: <input type=”text” name=”lastname” size=”30” > <br/>
    </form>
</body>
</html>

Save the document with the name AddingTextField.html and open on browser.