引导表格选择
当您要允许用户从多个选项中进行选择时,将使用一个选择,但是默认情况下,它仅允许一个。
将<select>用于用户熟悉的列表选项,例如状态或数字。
使用multiple=“multiple”允许用户选择多个选项。
示例
您可以尝试运行以下代码以实现Bootstrap表单选择
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta name = "viewport" content="width = device-width, initial-scale = 1">
<link rel = "stylesheet" href = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
<script src = "https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
<script src = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
</head>
<body>
<form role = "form">
<div class = "form-group">
<label for = "name">Country</label>
<select class = "form-control">
<option>India</option>
<option>Australia</option>
<option>US</option>
</select>
</div>
</form>
</body>
</html>