How to Create Text Box in Html

If we want to create the text box in Html document for inserting the characters by the user on the web page then we have to follow the steps which are given below. Using these steps, any user can easily create a text box.

Step 1: Firstly, we have to type the Html code in any text editor or open the existing Html file in the text editor in which we want to create the text box.

Step 2: For creating the text box, firstly we have to define the

tag
, if not defined in the code. Now, we have to place the cursor at that point in the
tag where we want to create the text box. And, then we have to type the tag at that point.

Step 3: After writing the tag, we have to use its attribute whose name is type. This attribute specifies what type of data is to be entered. So, to create the text box we have to give the value "text" in the type attribute.

Step 4: If we want to define the width of the text box, then we can define it with the help of the size attribute.

Step 5: And, at last, we have to save the Html file and then run the file in the browser.

Test it Now

The output of above Html code is shown in the following screenshot:

How to Create Text Box in Html




Contact US

Email:[email protected]

How to Create Text Box in Html
10/30