When setting a radio button, remember to set its name to the same value, so that the radio button can be implemented! !
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Bootstrap 实例 - 复选框和单选按钮</title> <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="checkbox"> <label ><input type="checkbox" name="">篮球</label> <label ><input type="checkbox" name="">足球</label> </div> <div class="radio"> <label ><input type="radio" name="optionsRadio" checked>篮球</label> <label ><input type="radio" name="optionsRadio">足球</label> </div> <div class="radio"> <label> <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1"</option 1 >checkedlabel > </ div > < div class ="radio" > < label > < input type ="radio" name ="optionsRadios" id ="optionsRadios2" value ="option2" > option 2 - selecting it will deselect the option 1 </ label > </ div > </ body > </ html >