Bootstrap Tutorial - Create toggle button with pencil icon








The following code shows how to create toggle button with pencil icon.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
<script type='text/javascript'
  src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/js/bootstrap.js"></script>
</head><!-- w w w . j a va2s  . c  om-->
<body style='margin:30px'>
  <label class="btn btn-primary"> 
  <i class="icon-pencil icon-white"></i> 
  <input type="checkbox" name="foo"
    class="hide" data-toggle="button" value="1" />
  </label>
</body>
</html>

Click to view the demo