VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-checks-and-radios-checks/

⇱ Bootstrap 5 Checks and radios Checks - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Checks and radios Checks

Last Updated : 12 Dec, 2022

Bootstrap 5 Checks box is a square box that is ticked when it is activated. It allows the user to select one or more options among all the limited choices. 

The checkbox check is used to tick (select) the checkbox item. The check has two options that are given below:

  • Indeterminate: The checkboxes can use the :indeterminate pseudo-class to set the check state to indeterminate. It can be set by using JavaScript.
  • Disabled: It is used to disable the checkboxes. To disable the checkbox, we will use the disabled attribute.

Syntax:

<div class="form-check">
 <input class="form-check-input" 
 type="checkbox" value="..." id="...">
 <label class="form-check-label" for="...">
 Content
 </label>
</div>
 

Example 1: In this example, we will create checkbox elements.

Output:

👁 Image
 

Example 2: In this example, we will create checkboxes with indeterminate states.

Output:

👁 Image
 

Example 3: In this example, we will create disabled states checkboxes.

Output:

👁 Image
 

Reference: https://getbootstrap.com/docs/5.0/forms/checks-radios/#checks

Comment

Explore