Creating a clickable tooltip in javascript or bootstrap

What is the best way to make a clickable tooltip like the one in the picture below:

enter image description here

Should I use bootstrap or some other library?




Here You go

html: true,
content: function () {
    return $('#popover-content').html();
[data-style=mypops] + .popover {
background: #4194ca;
[data-style=mypops] + .popover.bottom .arrow:after {
border-bottom-color: #4194ca;
[data-style=mypops] + .popover-content {
.popovermenu {
list-style: none;
padding: 0px;
margin: 0px;
.popovermenu li {
.popovermenu li a {
color: #fff;
<script src=""></script>
<script src=""></script>
<link rel="stylesheet" href="" />
<div class="col-sm-4">
    <button tabindex="0" class="btn btn-default" role="button" data-toggle="popover" data-trigger="focus" data-placement="bottom" data-style="mypops" id="Pops">Click Me</button>
    <div id="popover-content" class="hide">
      <ul class="popovermenu">
        <li><a href="#">Action</a></li>
        <li><a href="#">Another action</a></li>
        <li><a href="#">Separated link</a></li>


  • Added custom data-style="mypops" in popover button and add in css so popover can be customized without effecting the default popover in bootstrap.
  • Replaced data-trigger="click" with data-trigger="focus" in popover button so if click one a link or outside the popover window, popover will be auto closed.



$('[data-toggle="popover"]').popover({ trigger: "manual" , html: true, animation:false})
    .on("mouseenter", function () {
        var _this = this;
        $(".popover").on("mouseleave", function () {
    }).on("mouseleave", function () {
        var _this = this;
        setTimeout(function () {
            if (!$(".popover:hover").length) {
        }, 300);
<script src=""></script>
<!DOCTYPE html>
<html lang="en">
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="">
  <script src=""></script>
  <script src=""></script>
  <script src=""></script>
<div class="container">
  <h3>Popover Example</h3>
<a href="#" role="button" class="btn popovers" data-toggle="popover" title="" data-content="test content <a href='' title='test add link'>link on content</a>" data-original-title="test title">test link</a>


You can use Bootstrap's popover and use the template option to include clickable links in your tooltip. There are also options regarding the tooltip's position.

$(function (){
        template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>',
        placement: 'right'


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.