Tooltip Methods tooltip('toggle') - HTML CSS Bootstrap

HTML CSS examples for Bootstrap:Tooltip

Description

Tooltip Methods tooltip('toggle')

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
 <head> 
  <meta charset="utf-8"> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <title>Example of Bootstrap 3 Tooltip Methods</title> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

  <script type="text/javascript">
$(document).ready(function(){
    $(".show-tooltip").click(function(){
       $("#myTooltip").tooltip('show');
    });<!--   w  ww. j  a v a2 s. c om-->
    $(".hide-tooltip").click(function(){
       $("#myTooltip").tooltip('hide');
    });
    $(".toggle-tooltip").click(function(){
       $("#myTooltip").tooltip('toggle');
    });
    $(".destroy-tooltip").click(function(){
       $("#myTooltip").tooltip('destroy');
    });
});
</script> 
  <style type="text/css">
  .bs-example{
      margin: 60px;
    }
</style> 
 </head> 
 <body> 
  <div> 
   <p> <a href="#" data-toggle="tooltip" id="myTooltip" title="This is default title">Tooltip Example</a> </p> 
   <div> 
    <p>Click on the following buttons to control the tooltip manually.</p> 
    <input type="button" class="btn btn-primary show-tooltip" value="Show"> 
    <input type="button" class="btn btn-warning hide-tooltip" value="Hide"> 
    <input type="button" class="btn btn-success toggle-tooltip" value="Toogle"> 
    <input type="button" class="btn btn-danger destroy-tooltip" value="Destroy"> 
   </div> 
  </div>   
 </body>
</html>

Related Tutorials