]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add getInstance method in the docs for tooltip (#31636)
authorRohit Sharma <rohit2sharma95@gmail.com>
Tue, 15 Sep 2020 05:28:08 +0000 (10:58 +0530)
committerGitHub <noreply@github.com>
Tue, 15 Sep 2020 05:28:08 +0000 (08:28 +0300)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
site/content/docs/5.0/components/tooltips.md

index 947a50f88d2c2e1118806df7fe4b593752b3a4e8..21c952d4660f91825ad02df2b88477e34ae81a5a 100644 (file)
@@ -358,6 +358,15 @@ Updates the position of an element's tooltip.
 
 {{< highlight js >}}tooltip.update(){{< /highlight >}}
 
+#### getInstance
+
+*Static* method which allows you to get the tooltip instance associated with a DOM element
+
+{{< highlight js >}}
+var exampleTriggerEl = document.getElementById('example')
+var tooltip = bootstrap.Tooltip.getInstance(exampleTriggerEl) // Returns a Bootstrap tooltip instance
+{{< /highlight >}}
+
 ### Events
 
 <table class="table">