input type='text' - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:input

Introduction

If you set the type attribute to text, the browser will display a single-line text box.

The following table summarizes the attributes that are available for this input element type.

Attribute Description
dirname Specifies a value for the name of the directionality of the text.
listSpecifies the id of a datalist element that provides values for this element.
maxlength Specifies the maximum number of characters that the user can enter into the text box.
pattern Specifies a regular expression pattern for the purposes of input validation.
placeholder Specifies a hint to the user as to the kind of input that you expect.
readonly If present, this attribute makes the text box read-only, and the user cannot edit the content.
required Specifies that the user must enter a value for the purposes of input validation.
size Specifies the width of the element, expressed as the number of characters that are visible in the text box.
valueSpecifies the initial value for the text box.

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body></body>
</html><!--from   ww  w.  j a va 2s  .  c o m-->

Related Tutorials