Bootstrap Tutorial - Add badge to button








The following code shows how to add badge to button.

Example

<!--   w  w w.jav a 2  s  .  co m-->
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet"
  href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet"
  href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<script
  src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script
  src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

</head>
<body style='margin:30px'>
    <div class="container">
      <a href="#" class="btn btn-primary btn-lg">Inbox <span class="badge">23</span></a>

    </div>
</body>
</html>

Click to view the demo