The form
is a Bootstrap element, which is mainly used in creating a form on our website.
Bootstrap select
is a form-control. It sets up a collapsible list of items that are selectable.
Bootstrap select
can be used in two ways.
Using the select
tag with the form-control
class.
Using the select
tag with the custom-control
class.
Note: Bootstrap 4 comes with customized form elements, which are meant to replace browser defaults. One of it is the
custom-select
class.
form
element creates our form.label
is included. This gives a caption to what is going to follow.select
tag with the class form-control
is included. This sets up for us, the select
button.Line 8: The form
element creates our form.
Line 9: A label
is included. This gives a caption to what is going to follow.
Line 10: A select
tag with the class custom-select
is included. This sets up the custom “select” button for us.
Bootstrap select
is easy to use in creating collapsible options to choose from. Notice the difference between the two outputs and try it yourself.