HTML | <input> size Attribute
The HTML <input> size Attribute is used to specify the visible width in terms of characters of an <input> element. It works with many input fields such as text, search, tel, URL, email, and password.
Syntax:
<input size="number">
Attribute values: It contains the numeric value which specifies the width of an input field in terms of the number of characters. Its default value is 20.
Example:
<!DOCTYPE html> < html > < head > < title >HTML input size Attribute</ title > </ head > < body > < h1 style = "color: green;" > GeeksforGeeks </ h1 > < h2 > HTML input size Attribute </ h2 > < input type = "text" value = "This is the default size." > < br > < br > < input type = "text" size = "50" value= "This is user specified size with value equals 50"> </ body > </ html > |
Output:
Supported Browsers: The browser supported by HTML input size Attribute are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari