Open In App

What is the use of size Attribute in <input type=”text”> Tags ?

The “size” attribute in <input type="text"> tags specify the visible width of the text input field, indicating the number of characters that can be displayed horizontally within the input box. This attribute affects the visual appearance of the input field but does not limit the actual length of the input data.

Syntax

<input type="text" size="number_of_characters">
Key Point Description
Visual Width The “size” attribute determines the width of the text input field in terms of the number of characters it can display horizontally.
Display Only The attribute does not restrict the length of the input data; it merely affects the visual presentation of the input field.
Default Width If the “size” attribute is not specified, the browser typically renders the input field with a default width suitable for displaying a moderate amount of text.

Features

Article Tags :