Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap 4 Tooltip Methods</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script> <style> .bs-example{ margin: 100px auto; } .bs-example a{ font-size: 20px; } </style> <script> $(document).ready(function(){ $(".show-tooltip").click(function(){ $("#myTooltip").tooltip('show'); }); $(".hide-tooltip").click(function(){ $("#myTooltip").tooltip('hide'); }); $(".toggle-tooltip").click(function(){ $("#myTooltip").tooltip('toggle'); }); $(".enable-tooltip").click(function(){ $("#myTooltip").tooltip('enable'); }); $(".disable-tooltip").click(function(){ $("#myTooltip").tooltip('disable'); }); $(".toggle-enabled-tooltip").click(function(){ $("#myTooltip").tooltip('toggleEnabled'); }); $(".toggle-update").click(function(){ $("#myTooltip").tooltip('update'); }); $(".destroy-tooltip").click(function(){ $("#myTooltip").tooltip('dispose'); }); }); </script> </head> <body> <div class="bs-example text-center"> <p> <a href="#" data-toggle="tooltip" id="myTooltip" title="This is default title">Tooltip Example</a> </p> <div class="mt-4"> <p>Click on the following buttons to control the tooltip manually.</p> <button type="button" class="btn btn-primary show-tooltip">Show</button> <button type="button" class="btn btn-warning hide-tooltip">Hide</button> <button type="button" class="btn btn-success toggle-tooltip">Toogle</button> <button type="button" class="btn btn-info enable-tooltip">Enable</button> <button type="button" class="btn btn-secondary disable-tooltip">Disable</button> <button type="button" class="btn btn-dark toggle-enabled-tooltip">Toogle Enabled</button> <button type="button" class="btn btn-warning update-tooltip">Update</button> <button type="button" class="btn btn-danger destroy-tooltip">Destroy</button> </div> </div> </body> </html>