Bootstrap Tutorial - Place checkbox or radio option within an input group








The following code shows how to place checkbox or radio option within an input group.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-git2.js'></script>
<link rel="stylesheet" type="text/css"
  href="http://getbootstrap.com/assets/css/docs.css">
<link rel="stylesheet" type="text/css"
  href="http://getbootstrap.com/dist/css/bootstrap.css">
<script type='text/javascript'
  src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
</head><!--from ww w .  j a va  2  s.  co m-->
<body style='margin:30px'>
  <h3 id="btn-groups-single">Checkboxes and radio buttons</h3>
  <div class="row">
    <div class="col-lg-6">
      <div class="input-group">
        <span class="input-group-addon"> 
           <input type="checkbox">
        </span> 
        <input type="text" class="form-control">
      </div>
    </div>
    <div class="col-lg-6">
      <div class="input-group">
        <span class="input-group-addon"> 
           <input type="radio">
        </span> 
        <input type="text" class="form-control">
      </div>
    </div>
  </div>
</body>
</html>

Click to view the demo