<!DOCTYPE html>
<
html
lang
=
"en"
>
<
head
>
<
link
href
=
rel
=
"stylesheet"
integrity
=
"sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin
=
"anonymous"
>
<
script
src
=
integrity
=
"sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin
=
"anonymous"
>
</
script
>
</
head
>
<
body
class
=
"m-3"
>
<
h1
class
=
"text-success"
>
GeeksforGeeks
</
h1
>
<
h2
>Bootstrap 5 Popovers show() Method</
h2
>
<
button
type
=
"button"
id
=
"example"
data-bs-content
=
"Hi Geek!!"
data-bs-placement
=
"bottom"
class
=
"btn btn-info"
>
Popover element
</
button
>
<
button
type
=
"button"
id
=
"show"
class
=
"btn btn-success"
>
Show Popover Manually using this Button
</
button
>
<
button
type
=
"button"
id
=
"hide"
class
=
"btn btn-danger"
>
Hide Popover Manually using this Button
</
button
>
<
script
>
const exampleEl = document.getElementById('example')
const popover = new bootstrap.Popover(exampleEl)
const hideButton = document.getElementById('hide')
const showButton = document.getElementById('show')
hideButton.addEventListener('click', () => {
popover.hide()
})
showButton.addEventListener('click', () => {
popover.show()
})
</
script
>
</
body
>
</
html
>