Bootstrap Popovers
The bootstrap popover plugin is very similar to tooltips.  To create a popover, add the data-toggle="popover" attribute to an element and the title attribute to specify the header text of the popover, the data-content attribute to specify the text that should be displayed inside the popover's body.

Usage

The popover plugin generates content and markup on demand, and by default places popover after their trigger element. Enable popovers via JavaScript:
$('#example').popover(options)
<!DOCTYPE html>
<html>
<head>
   <title>Bootstrap Popover</title>
   <meta name="viewport" content="width=device-width,initial-scale=1">
   <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
   <script type="text/javascript" src="../js/jquery.min.js"></script>
   <script type="text/javascript" src="../js/bootstrap.min.js"></script>
</head>
<body>
 
<div class="container-fluid">
 
 <div style="padding:50px;">
  <a href="#" class="btn btn-primary" data-toggle="popover" 
   title="Popover Header" data-content="Popover Sample Content">Toggle popover</a>
 </div>
 
<script type="text/javascript">
$(document).ready(function(){
    $('[data-toggle="popover"]').popover();   
});
</script>
 
</div>
 
</body>
</html> 
Output :
Directions Popovers
You can set popovers to appear on top, right, bottom and left sides of an element.
<!DOCTYPE html>
<html>
<head>
   <title>Directions Popovers</title>
   <meta name="viewport" content="width=device-width,initial-scale=1">
   <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
   <script type="text/javascript" src="../js/jquery.min.js"></script>
   <script type="text/javascript" src="../js/bootstrap.min.js"></script>
</head>
<body>
 
<div class="container-fluid">
 
 <div style="padding:50px 10px;">
 
  <ul class="list-inline">
    <li><a href="#" class="btn btn-primary" title="Sample Header" 
    data-toggle="popover" data-placement="top" data-content="This is sample content...">
    Top Popover</a></li>
    <li><a href="#" class="btn btn-success" title="Sample Header" 
    data-toggle="popover" data-placement="bottom" data-content="This is sample content...">
     Bottom Popover</a></li>
    <li><a href="#" class="btn btn-warning" title="Sample Header" 
    data-toggle="popover" data-placement="left" data-content="This is sample content...">
    Left Popover</a></li>
    <li><a href="#" class="btn btn-info" title="Sample Header" 
    data-toggle="popover" data-placement="right" data-content="This is sample content...">
    Right Popover</a></li>
  </ul>
  
 </div>
 
<script type="text/javascript">
$(document).ready(function(){
    $('[data-toggle="popover"]').popover();   
});
</script>
 
</div>
 
</body>
</html> 
Output :
Popovers via JavaScript
<!DOCTYPE html>
<html>
<head>
   <title>Popovers via JavaScript</title>
   <meta name="viewport" content="width=device-width,initial-scale=1">
   <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
   <script type="text/javascript" src="../js/jquery.min.js"></script>
   <script type="text/javascript" src="../js/bootstrap.min.js"></script>
</head>
<body>
 
<div class="container-fluid">
 
 <script type="text/javascript">
$(document).ready(function(){
    $(".popover-top").popover({
        placement : 'top'
    });
    $(".popover-right").popover({
        placement : 'right'
    });
    $(".popover-bottom").popover({
        placement : 'bottom'
    });
    $(".popover-left").popover({
        placement : 'left'
    });
});
</script>
<style type="text/css">
.popover_margin{ margin: 100px 5px;}
.popover_mar_bottom{  margin-bottom: 20px;}
</style>
 
<div class="popover_margin">
    <div class="popover_mar_bottom">
        <button type="button" class="btn btn-primary popover-top" data-toggle="popover" 
        title="Sample title" data-content="This is sample content on Top popover.">Popover on top</button>
        <button type="button" class="btn btn-success popover-right" data-toggle="popover" 
        title="Sample title" data-content="This is sample content on Right popover.">Popover on right</button>
        <button type="button" class="btn btn-warning popover-bottom" data-toggle="popover" 
        title="Sample title" data-content="This is sample content on Bottom popover.">Popover on bottom</button>
        <button type="button" class="btn btn-info popover-left" data-toggle="popover" 
        title="Sample title" data-content="This is sample content on Left popover.">Popover left</button>
    </div>
</div>
 
</div>
 
</body>
</html>
Output :
Hiding the Popovers on Next Click
<!DOCTYPE html>
<html>
<head>
   <title>Hiding the Popovers on Next Click</title>
   <meta name="viewport" content="width=device-width,initial-scale=1">
   <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
   <script type="text/javascript" src="../js/jquery.min.js"></script>
   <script type="text/javascript" src="../js/bootstrap.min.js"></script>
</head>
<body>
 
<div class="container-fluid">
 
<style type="text/css">
.popover_margin{ margin: 100px 5px 50px;}
.popover_mar_bottom{  margin-bottom: 20px;}
.hover_margin{ margin:20px 5px;}
</style>
 
<script type="text/javascript">
$(document).ready(function(){
    $('[data-toggle="popover"]').popover({
        placement : 'top'
    });
});
</script>
<div class="popover_margin">
    <div class="popover_mar_bottom">
        <a href="#" class="btn btn-primary" data-toggle="popover" 
        tabindex="0" data-trigger="focus" title="Sample Title" 
        data-content="Default popover">Popover</a>
        <a href="#" class="btn btn-success" data-toggle="popover" 
        tabindex="1" data-trigger="focus" title="Sample Title" 
        data-content="Another popover">Another popover</a>
        <a href="#" class="btn btn-warning" data-toggle="popover" 
        tabindex="2" data-trigger="focus" title="Sample Title" 
        data-content="A larger popover to demonstrate the max-width of the Bootstrap popover.">
        Large popover</a>
        <a href="#" class="btn btn-info" data-toggle="popover" 
        tabindex="3" data-trigger="focus" title="Sample Title" 
        data-content="The last tip!">Last popover</a>
    </div>
</div>
 
<h4>Hover Popover</h4>
 
<div class="hover_margin">
    <a href="#" class="btn btn-primary" data-toggle="popover" 
    data-trigger="hover" title="Sample Title" 
    data-content="This is Sample Content.">Hover over me</a>
</div>
 
</div>
 
</body>
</html> 
Output :
Options
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".
Name Type Default Description
animation boolean true Apply a CSS fade transition to the popover
container string | false false

Appends the popover to a specific element. Example: container: 'body'. This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.

content string | function ''

Default content value if data-content attribute isn't present.

If a function is given, it will be called with its this reference set to the element that the popover is attached to.

delay number | object 0

Delay showing and hiding the popover (ms) - does not apply to manual trigger type

If a number is supplied, delay is applied to both hide/show

Object structure is: delay: { "show": 500, "hide": 100 }

html boolean false Insert HTML into the popover. If false, jQuery's text method will be used to insert content into the DOM. Use text if you're worried about XSS attacks.
placement string | function 'right'

How to position the popover - top | bottom | left | right | auto.
When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right.

When a function is used to determine the placement, it is called with the popover DOM node as its first argument and the triggering element DOM node as its second. The this context is set to the popover instance.

selector string false If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See this and an informative example.
template string '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'

Base HTML to use when creating the popover.

The popover's title will be injected into the .popover-title.

The popover's content will be injected into the .popover-content.

.arrow will become the popover's arrow.

The outermost wrapper element should have the .popover class.

title string | function ''

Default title value if title attribute isn't present.

If a function is given, it will be called with its this reference set to the element that the popover is attached to.

trigger string 'click' How popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space. manual cannot be combined with any other trigger.
viewport string | object | function { selector: 'body', padding: 0 }

Keeps the popover within the bounds of this element. Example: viewport: '#viewport' or { "selector": "#viewport", "padding": 0 }

If a function is given, it is called with the triggering element DOM node as its only argument. The this context is set to the popover instance.

Methods
The bootstrap popover methods are following :
Method Description Example

.popover(options)

Attaches a popover handler to an element collection.
$().popover(options)

.popover('toggle')

Toggles an element's popover.
$('#element').popover('toggle')

.popover('show')

Reveals an element's popover.
$('#element').popover('show')

.popover('hide')

Hides an element's popover.
$('#element').popover('hide')

.popover('destroy')

Hides and destroys an element's popover.
$('#element').popover('destroy')
Events
Event Type Description
show.bs.popover This event fires immediately when the show instance method is called.
shown.bs.popover This event is fired when the popover has been made visible to the user (will wait for CSS transitions to complete).
hide.bs.popover This event is fired immediately when the hide instance method has been called.
hidden.bs.popover This event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete).
inserted.bs.popover This event is fired after the show.bs.popover event when the popover template has been added to the DOM.
$('#myPopover').on('hidden.bs.popover', function () {
// some content...
})