Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • BS5 Tutorial
  • BS5 Interview Questions
  • BS5 Layout
  • BS5 Content
  • BS5 Components
  • BS5 Helpers
  • BS5 Utilities
  • BS4 Tutorial
  • BS Tutorial
  • Bootstrap Cheatsheet
  • Tailwind
  • CSS Frameworks
  • HTML Formatter
Open In App
Next Article:
Bootstrap 5 Checks and Radios Disabled
Next article icon

Bootstrap 5 Checks and radios Checks

Last Updated : 12 Dec, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

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.

HTML
<!DOCTYPE html> <html>  <head>     <title>Bootstrap 5 Checks and radios Checks</title>     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"         rel="stylesheet"         integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"         crossorigin="anonymous">     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"         integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"         crossorigin="anonymous">     </script> </head>  <body>     <div class="container">         <h1 class="text-success text-center">             GeeksforGeeks         </h1>          <h2 class="text-center">             Bootstrap5 Checks and radios Checks         </h2>          <h3>Select Technology</h3>         <div class="form-check">             <input class="form-check-input"                  type="checkbox" value="" id="html">             <label class="form-check-label" for="html">                 HTML             </label>         </div>          <div class="form-check">             <input class="form-check-input"                  type="checkbox" value="" id="css">             <label class="form-check-label" for="css">                 CSS             </label>         </div>          <div class="form-check">             <input class="form-check-input"                  type="checkbox" value="" id="js">             <label class="form-check-label" for="js">                 JavaScript             </label>         </div>                  <div class="form-check">             <input class="form-check-input" type="checkbox"                  value="" id="bootstrap" checked>             <label class="form-check-label" for="bootstrap">                 Bootstrap             </label>         </div>     </div> </body>  </html> 

Output:

 

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

HTML
<!DOCTYPE html> <html>  <head>     <title>Bootstrap 5 Checks and radios Checks</title>     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"         rel="stylesheet"         integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"         crossorigin="anonymous">     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"         integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"         crossorigin="anonymous">     </script> </head>  <body>     <div class="container">         <h1 class="text-success text-center">             GeeksforGeeks         </h1>          <h2 class="text-center">             Bootstrap 5 Checks and radios Checks         </h2>          <h3>Select Technology</h3>         <div class="form-check">             <input class="form-check-input"                  type="checkbox" value="" id="html">             <label class="form-check-label" for="html">                 HTML             </label>         </div>          <div class="form-check">             <input class="form-check-input"                  type="checkbox" value="" id="css">             <label class="form-check-label" for="css">                 CSS             </label>         </div>          <div class="form-check">             <input class="form-check-input"                  type="checkbox" value="" id="js">             <label class="form-check-label" for="js">                 JavaScript             </label>         </div>          <div class="form-check">             <input class="form-check-input" type="checkbox"                  value="" id="bootstrap" checked>             <label class="form-check-label" for="bootstrap">                 Bootstrap             </label>         </div>     </div>      <script>         var doc = document.getElementsByTagName("input");                  for (var i = 0; i < doc.length; i++) {             doc[i].indeterminate = true;         }     </script> </body>  </html> 

Output:

 

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

HTML
<!DOCTYPE html> <html>  <head>     <title>Bootstrap 5 Checks and radios Checks</title>     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"         rel="stylesheet"         integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"         crossorigin="anonymous">     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"         integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"         crossorigin="anonymous">     </script> </head>  <body>     <div class="container">         <h1 class="text-success text-center">             GeeksforGeeks         </h1>          <h2 class="text-center">             Bootstrap 5 Checks and radios Checks         </h2>          <h3>Select Technology</h3>         <div class="form-check">             <input class="form-check-input"                  type="checkbox" id="html" disabled>             <label class="form-check-label" for="html">                 HTML             </label>         </div>          <div class="form-check">             <input class="form-check-input"                  type="checkbox" id="css">             <label class="form-check-label" for="css">                 CSS             </label>         </div>          <div class="form-check">             <input class="form-check-input"                  type="checkbox" id="js">             <label class="form-check-label" for="js">                 JavaScript             </label>         </div>          <div class="form-check">             <input class="form-check-input" type="checkbox"                  value="" id="bootstrap" checked disabled>             <label class="form-check-label" for="bootstrap">                 Bootstrap             </label>         </div>     </div> </body>  </html> 

Output:

 

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


Next Article
Bootstrap 5 Checks and Radios Disabled

V

vkash8574
Improve
Article Tags :
  • Technical Scripter
  • Web Technologies
  • Bootstrap
  • Technical Scripter 2022
  • Bootstrap-5

Similar Reads

    Forms

    Bootstrap 5 Overview Form text
    Bootstrap 5 Overview Form Text sits below the form input elements to guide the user on how to fill in the input. Form text can be added to input by using a container(a <div> or a <span>) having the class form-text with the text inside it. If we use a block element for the text the top ma
    2 min read
    Bootstrap 5 Overview Disabled forms
    In Bootstrap, you can easily disable input in a form and stop it from interacting by using the disabled attribute. This is mainly used in forms where some fields are not available for all users to fill in. Although buttons are visibly disabled with this attribute you need to add the tabindex="-1" to
    2 min read

    Form controls

    Bootstrap 5 Form Controls Sizing
    Bootstrap 5 Form controls Sizing gives textual form controls on <input>, <select>, and <textarea> elements with custom styles, sizing, focus states, and more.Bootstrap 5 Form Controls Sizing Classes:form-control-sm: This class is used to make the size of the form control small.form
    2 min read
    Bootstrap 5 Form Controls Disabled
    Bootstrap5 Form controls Disabled are used to create a disabled input field. To create a disabled input field, we will use the disabled boolean attribute on an input to disable the input field. It will remove any pointer event from the field. Form controls Disabled Class: There are no pre-defined cl
    2 min read
    Bootstrap 5 Form Controls Readonly
    Bootstrap 5 Form Controls Readonly is used to create a read-only input field. To create a read-only input field, we will use readonly attribute on an input to prevent modification of the input’s value. It is useful when we want to have a fixed value for the input. Bootstrap 5 Form controls Readonly
    2 min read
    Bootstrap 5 Form controls Readonly plain text
    Bootstrap 5 Form Controls Readonly plain text is used to create a readonly input field as a plaintext. To create a plain text input field, we will use .form-control-plaintext class. This class removes the styling and preserves the correct margin and padding. Form Control Readonly Attribute: readonly
    2 min read
    Bootstrap 5 Form Controls File Input
    Bootstrap5 Form controls File input provides customized ways to take the input of the files, i.e., the file input can accept as default, or can accept multiple files at once, or can be disabled the file input. This can also be done for any file input size, which varies from small size to large. This
    2 min read
    Bootstrap 5 Form controls Color
    Bootstrap 5 is the newest version of Bootstrap, which is the most popular HTML, CSS, and JavaScript framework for creating responsive, mobile-first websites. It was officially released on 16 June 2020 after several months of redefining its features. Bootstrap 5 Form Control Color is used to set the
    2 min read
    Bootstrap 5 Form controls Datalists
    Bootstrap 5 is the newest version of Bootstrap, which is the most popular HTML, CSS, and JavaScript framework for creating responsive, mobile-first websites. It was officially released on 16 June 2020 after several months of redefining its features. Bootstrap 5 Form controls datalists are used to cr
    2 min read
    Bootstrap5 Form controls SASS
    Bootstrap 5 Form controls can be used to change the default values provided for the Form controls by customizing scss file of bootstrap 5. SASS variables of Form controls: $input-color: This variable provides the cursor color and the font color of the text typed into the input fields. By default, it
    7 min read

    Form Select

    Bootstrap 5 Select Default
    Bootstrap 5 Select Default stylizes dropdown menus, enhancing user experience. However, limitations exist in modifying option styles due to browser constraints, despite offering various customization options for select elements. Bootstrap 5 Select Default Class: form-select: This class is used to tr
    2 min read
    Bootstrap 5 Select Disabled
    Bootstrap 5 Select is a great component that helps us to add options that can be used inside a form as a field. Disabling a select menu just required the disabled attribute to be added to the select tag. Bootstrap 5 Select Disabled Attributes:disabled: This attribute when added to the select tag, th
    2 min read
    Bootstrap 5 Select SASS
    Bootstrap 5 Select SASS can be used to change the default values provided for the select menus by customizing scss file.SASS variables of Select:$form-select-padding-y: This variable provides the top and bottom padding of the form select. By default, it is 0.375rem.$form-select-padding-x: This varia
    7 min read

    Form Checks and radios

    Bootstrap 5 Checks and radios Checks
    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
    3 min read
    Bootstrap 5 Checks and Radios Disabled
    Bootstrap 5 Checks and radios Disabled is used to make a checkbox/radio disabled, which means we won't be able to click on it. Its appearance will also get muted. Add the disabled attribute and the associated <label>s are automatically styled with a lighter color to indicate its disabled state
    2 min read
    Bootstrap 5 Checks and radios Switches
    Bootstrap5 Checks and radios Switches are used to transform the Checks and Radio Inputs into switches. They are transformed as .form-switch is added to the HTML div containing the input and the label. The prime difference between the checkbox and radio switch is the role attribute which is set to ra
    3 min read
    Bootstrap 5 Checks and radios Default (stacked)
    behaviorBootstrap 5 Checks and radios Default (stacked) is used to create a stack of checks and radios as a list. To create a stack we need to put the checks and radios normally one by one that will create stacks it's the default behaviour of Bootstrap 5 Checks and radios. Bootstrap 5 Checks and rad
    2 min read
    Bootstrap 5 Checks and radios Inline
    Bootstrap 5 Checks and radios Inline can be used to align the checkbox or radio horizontally in the same line. Bootstrap 5 Checks and radios Inline Class: form-check-inline: This class makes all the checkboxes or radios inline or beside each other which are inside the div having this class. Syntax:
    2 min read
    Bootstrap 5 Checks and Radios Without Labels
    Bootstrap 5 Checks and radios are a way to take boolean type values easily. Generally, they have a label that shows what value it is taking mainly for user experience and some assistive technologies to work correctly. The label can be removed too for the switch as well as the radio inputs. Checks an
    2 min read
    Bootstrap 5 Buttons Toggle states
    Bootstrap 5 Buttons Toggle states are used to change the button states. A button has three toggle states, they are passive, active, and disabled. We can add the button to the data-bs-toggle attribute to the button to toggle a button’s active state. For the passive state, we can just use the syntax b
    2 min read
    Bootstrap 5 Checks and radios Checkbox Toggle buttons
    Bootstrap 5 Checks and radios Checkbox Toggle buttons are a way of visualizing the checkboxes as buttons and primarily the .form-check is changed to .btn-check and the .form-check-label is changed to buttons classes. There are three toggle states, the first is checked followed by unchecked and disab
    2 min read
    Bootstrap 5 Checks and radios Radio Toggle Buttons
    Bootstrap 5 Checks and Radios Radio Toggle Buttons use buttons instead of round-shaped radio buttons. This can be achieved by removing the form-check-label class from the label element of the radio and adding the btn class to it. Variations of buttons like outlined styles can also be used instead of
    2 min read
    Bootstrap 5 Checks and Radios Outlined Styles
    Bootstrap 5 provides us with utility Checks and radios with outlined styles for different looks, designs,s and background colors. Checks and radios Outlined styles Classes: No special classes are used in Outlined styles. You can customize the component using Button Outline. Different variants of .bt
    2 min read

    Form Range

    Bootstrap 5 Range Min and Max
    Bootstrap5 Range Min and Max attributes are used for altering the minimum and maximum values of the range. By default, the minimum value of the range is 0 and the maximum value is 100. There is no specific class used for Range Min and Max. Although, we can set the values for min and max by specifyin
    2 min read
    Bootstrap 5 Range Steps
    Bootstrap5 Range Step is the factor by which the value of the range input will increment or decrement in one step. The default value of the step is 1 and can be altered by setting the step attribute of the range to the desired value. There is no specific class used for the Range Steps. Although, the
    2 min read
    Bootstrap 5 Range SASS
    Bootstrap 5 Range SASS has a set of variables with default values that can be changed to customize the container. We can customize the range component by changing the default value of the variables. Bootstrap 5 Range SASS variables : $form-range-track-width: It is the width of the range tracking.
    4 min read

    Form Input group

    Bootstrap 5 Input group Sizing
    Bootstrap 5 Input group Sizing is used to extend the default form controls by adding text or buttons on either side of textual inputs, custom file selectors, or custom inputs. In this article, we will learn about Input group sizing. Input Group sizing helps us to create input groups of small, large,
    2 min read
    Bootstrap 5 Input group Checkboxes and Radios
    Bootstrap 5 Input group Checkboxes and radios are used to pace the radios and checkboxes within an input group’s addon instead of text.Bootstrap 5 Input group Checkboxes and Radios Classes: There are no specific classes to add checkboxes and radios. To create the checkboxes and radios we use the for
    3 min read
    Bootstrap 5 Input Group Multiple Inputs
    Bootstrap 5 Input Group Multiple Inputs help to take multiple inputs in an input group. Multiple inputs in an input group do not support validations. Bootstrap 5 Input Group Multiple Inputs used Classes: There are no specific classes to create multiple inputs in input group. For creating the input g
    2 min read
    Bootstrap 5 Input group Multiple addons
    Bootstrap 5 Input group Multiple addons help to add multiple items in an input group which may include text, button, input, checkbox, radio, etc. Bootstrap 5 Input group Multiple addons Classes input-group: This class is used to create an input groupinput-group-text: This class is used to add text t
    2 min read
    Bootstrap 5 Input Group Button Addons
    Bootstrap 5 Input Groups are used to extend form controls by adding the buttons, text, or button groups before or after the text inputs, custom selects, or file inputs. Input Group Button Addons are used to extend form controls by adding buttons or button groups.Bootstrap 5 Input group Button Addons
    2 min read
    Bootstrap 5 Input group Buttons with dropdowns
    Bootstrap 5 Input group Buttons with dropdowns is used to display a button along with an input group. On Clicking this button, it gives a dropdown menu. Input group Buttons with dropdowns Classes: No special classes are used in Input group Buttons with dropdowns. You can customize the component usin
    2 min read
    Bootstrap 5 Input group Segmented Buttons
    Bootstrap 5 Input group Segmented buttons used to segment dropdowns in input groups, use the same general style as the dropdown button.Bootstrap 5 Input group Segmented buttons used classes: There is no specific class used to group Segmented buttons. To create a button, we use the .btn class, and to
    2 min read
    Bootstrap 5 Input group Custom forms
    Bootstrap 5 Input group Custom forms are extended form controls, used to collect specific information from visitors on your website. Custom form limits are placed on the number of unique forms you have created. There are two types of custom forms as follows:Custom select: The custom select menu is a
    2 min read
    Bootstrap 5 Input group Custom Select
    Bootstrap 5 Input Groups are used to extend form controls by adding the buttons, text, or button groups before or after the text inputs, custom selects, or file inputs.Bootstrap 5 Input group Custom select Classes: There is no specific class used to input group custom select. We use combinations of
    2 min read
    Bootstrap 5 Input group Custom file input
    Bootstrap 5 Input Groups are used to extend form controls by adding the buttons, text, or button groups before or after the text inputs, custom selects, or file inputs.Bootstrap 5 Input group Custom file input ClassesThere is no specific class used to Input group Custom file input. To create a butto
    2 min read
    Bootstrap 5 Input group Sass
    Bootstrap 5 Input group SASS has a set of variables with default values that can be changed to customize the Input groups. SASS variables for Input group: $input-group-addon-padding-y: This variable is used for padding in the y-axis$input-group-addon-padding-x: This variable is used for padding in t
    3 min read

    Form Floating labels

    Bootstrap 5 Floating labels Selects
    The Bootstrap 5 Floating labels Component Selects is used to give a floating label to input fields. It also works with the HTML 5 <select> component. When we apply a floating label to the select component the label will always be shown in the floating state irrespective of the state of the sel
    3 min read
    Bootstrap 5 Floating labels Layout
    Bootstrap 5 Floating labels Layout is useful when we are working with the grid system, so we have to place form elements within column classes. Floating labels Layout Classes: There are no pre-defined classes, we need to use Bootstrap5 form classes, and place them according to our needs. as we want
    2 min read
    Bootstrap 5 Floating labels SASS
    Bootstrap 5 Floating labels can be used to change the default values provided for the floating label by customizing scss file of bootstrap5.SASS variables of Floating Labels:$form-floating-height: This variable provides the height of the floating label. By default, it is 3.5rem.$form-floating-paddin
    5 min read

    Form Validation

    Bootstrap 5 Validation Browser defaults
    Bootstrap5 Validation Browser defaults provide feedback by browser default behaviors. It mainly uses browser default when we do not want to provide validation feedback messages or are not interested in writing javascript code for validation then we can use browser defaults. Browser default validatio
    2 min read
    Bootstrap 5 Validation Server side
    Bootstrap 5 Validation Server side provides valuable, actionable feedback to your users by browser default behaviors or custom styles and JavaScript. If you are using server-side validation, you can indicate invalid and valid form fields with .is-invalid and .is-valid and add .invalid-feedback & .va
    3 min read
    Bootstrap 5 Validation Supported Elements
    Bootstrap 5 Validation is supported by various elements present in the form and you can use it to make sure the user knows about which field is mandatory. The different elements in the form group which are supported are:<input>s and <textarea>s with .form-control<select>s with .for
    3 min read
    Bootstrap 5 Validation Tooltips
    Bootstrap 5 Validation Tooltips are used to provide interactive textual hints to the user about the requirements to submit the form. Bootstrap 5 Validation Tooltips classes: valid|invalid-feedback: This class is used to tell the user about what things are necessary for the form to be submitted.valid
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences