2 Example(s) of Bootstrap Tooltip


Description :

In tootip popup informative text about the respective element is given,which appears hovering over the element.


Bootstrap Tooltip Example - 1
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
    <div class="row col-md-offset-2">When you hover on any button , you will see a different tooltip in different direction according to instructions.</div>
    <br/>
    <div class="row">
        <div class="col-md-12 col-md-offset-2">
            <button type="button" class="btn btn-primary" data-toggle="tooltip" data-placement="bottom" title="Tooltip on left">Tooltip on left</button>

            <button type="button" class="btn btn-info" data-toggle="tooltip" data-placement="top" title="Tooltip on top">Tooltip on top</button>

            <button type="button" class="btn btn-danger" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom">Tooltip on bottom</button>

            <button type="button" class="btn btn-success" data-toggle="tooltip" data-placement="right" title="Tooltip on right">Tooltip on right</button>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    $(function () {
        $('[data-toggle="tooltip"]').tooltip()
    })
</script>

Output

Description :

Here tooltips are shown using jquery.


Bootstrap Tooltip Example - 2
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
    <div class="row col-md-offset-2">When you hover on any button , you will see a different tooltip in different direction according to instructions.</div>
    <br />
    <div class="row">
        <div class="col-md-12 col-md-offset-2">
            <button class="btn btn-danger btn-md" type="button">Left</button>
            <button class="btn btn-warning btn-md" type="button">Top</button>
            <button class="btn btn-success btn-md" type="button">Bottom</button>
            <button class="btn btn-info btn-md" type="button">Right</button>
        </div>
    </div>
</body>
</html>
<script>
    $(function () {
        $(".btn-danger").tooltip({ title: "Tooltip On Left", placement: "bottom" });
        $(".btn-warning").tooltip({ title: "Tooltip On Top", placement: "top" });
        $(".btn-success").tooltip({ title: "Tooltip On Bottom", placement: "bottom" });
        $(".btn-info").tooltip({ title: "Tooltip On Right", placement: "right" });
    });
</script>

Output