w3resource

HTML multiple attribute

multiple

If used, HTML multiple attribute allows multiple selections (with a select element).

Supported elements

HTML multiple attribute supports select element.

Syntax

<select multiple="multiple" >.....</select>

Value

multiple.

Default Value

There is not default value.

Supported doctypes

HTML 4.01 strict, HTML 4.01 transitional, HTML 4.01 frameset.

Example of HTML multiple attributes with select

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example of HTML multiple attribute with select</title>
</head>
<body>
<form>
<label for="favoritesports">Favorite Sports</label>
<select name="favoritesports" id="favoritesports"
multiple="multiple" size="10">
<option>Soccer</option>
<option>Hockey</option>
<option>Golf</option>
<option>Polo</option>
<option>Formula one </option>
</select>
</form>
</body>
</html>

Result

html multiple attribute with select

View this example in a separate browser window

Example of HTML multiple attribute with select

Previous: HTML method attribute
Next: HTML name attribute

Test your Programming skills with w3resource's quiz.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/html/attributes/html-multiple-attribute.php