"Single Button Toggle"
Bootstrap 3.3.0 Snippet by caruellej

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <div class="container"> <div class="well well-sm text-center"> <div class="" data-toggle="buttons"> <label class="btn btn-lg btn-success active"> <input type="radio" name="options" id="option1" autocomplete="off" checked> <i class="fa fa-heart" aria-hidden="true"></i> </label> <label class="btn btn-lg btn-danger"> <input type="radio" name="options" id="option2" autocomplete="off"> <i class="fa fa-heart-o" aria-hidden="true"></i> </label> </div> </div> </div> </div>
.btn span:nth-of-type(1) { display: none; } .btn span:last-child { display: block; } .btn.active span:nth-of-type(1) { display: block; } .btn.active span:last-child { display: none; }

Related: See More


Questions / Comments: