How Can I Create a Text Box in HTML

Standard Text Box:

The standard text box which a user can type into is shown below:



Text Box with READONLY attribute:

A text box that has a READONLY attribute appened to it is shown below:



This text box allows a user to click inside of it, but the user cannot enter any characters into it.
The READONLY attribute means that a user to the site cannot enter anything inside of it.

Text Box with disabled="disabled":

The text box which has the line disabled="disabled" is shown below:



This text box, just like the one with the READONLY attribute, does not allow a user to type into this field.
However, unlike the READONLY attribute, a user can't even click inside this field. It is totally disabled.

Examples:

Below are examples of text boxes using the READONLY attribute and the line disabled="disabled.

Calculator (X=a+b)

Enter a:

Enter b:

Answer X:

Here the user cannot delete the answer and type in something else or add to the answer.
This is the use of a READONLY attribute.

Below is the same text box only now it has the disabled="disabled" line added to it.

Enter a:

Enter b:

Answer X:

Now with this line added to the answer text box, a user can't even click inside of the text box.