size
Definition and Example
It defines the number of visible items in the drop-down list. If the size
attribute has the value “1” and the multiple
attribute is absent, browsers will usually display a drop-down box. Otherwise, the control will take the form of a scrollable box.
In size attribute of select tag , if you have many options, you might want to display more options to the user (without them having to scroll or interact with the control first).You can use the size
attribute to specify the number of options to show the user.
Attribute Values
Value | Description |
---|---|
number | The number of visible options in the drop-down list. Default value is 1. If the multiple attribute is present, the default value is 4 |