size attribute | size property
Sets or retrieves the size of the control.
![]() |
Syntax
| HTML | <element size="p" ... > |
|---|---|
| JavaScript | |
Property values
Type: Integer
The size, in characters.
Standards information
- Document Object Model (DOM) Level 1 Specification, Section 2.5.5
- HTML 4.01 Specification, Section 17.4
Remarks
Although this property is read/write, no change is visible when you set the size of the input type=reset, input type=submit, and input type=image objects. However, you can detect a change to the size property for these objects in code.
For the input type=text object, the size is in characters and represents the width of the text box. When the size is specified, the select object represents a list box with the specified number of rows.
See also
- input type=button
- input type=checkbox
- input type=email
- input type=file
- input type=image
- input type=number
- input type=password
- input type=radio
- input type=range
- input type=reset
- input type=search
- input type=submit
- input type=tel
- input type=text
- input type=url
- maxLength
Show:
