From: Rohit Sharma Date: Tue, 15 Sep 2020 05:28:08 +0000 (+0530) Subject: Add getInstance method in the docs for tooltip (#31636) X-Git-Tag: v5.0.0-alpha2~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94c0f12329820494c39fe7c213866620416d0b38;p=thirdparty%2Fbootstrap.git Add getInstance method in the docs for tooltip (#31636) Co-authored-by: XhmikosR --- diff --git a/site/content/docs/5.0/components/tooltips.md b/site/content/docs/5.0/components/tooltips.md index 947a50f88d..21c952d466 100644 --- a/site/content/docs/5.0/components/tooltips.md +++ b/site/content/docs/5.0/components/tooltips.md @@ -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