---
title: "Comment by Gary Varnum on \"Building a Popover with only CSS\" | Hashnode"
description: "How could I close the popover without clicking on the &lt;summary&gt; element again? I would like to place a &quot;close&quot; icon in the &lt;p&gt; like in a m"
url: "https://hashnode.com/posts/building-a-popover-with-only-css/61094c41725d9303e0350608/comment/63ed27ec3fa8ff4ff0097d5b"
---

[Discussion](https://hashnode.com/posts/building-a-popover-with-only-css/61094c41725d9303e0350608)

Comment [Building a Popover with only CSS](https://hashnode.com/posts/building-a-popover-with-only-css/61094c41725d9303e0350608)

[Gary Varnum](https://hashnode.com/@varNum462)

[Feb 15, 2023](https://hashnode.com/posts/building-a-popover-with-only-css/61094c41725d9303e0350608/comment/63ed27ec3fa8ff4ff0097d5b)

How could I close the popover without clicking on the <summary> element again? I would like to place a "close" icon in the <p> like in a modal, but can't tell how to hide the popover when the icon is clicked..

[Nathan Kallman](https://hashnode.com/@kallmanation)

[Mar 17, 2023](https://hashnode.com/posts/building-a-popover-with-only-css/61094c41725d9303e0350608/comment/63ed27ec3fa8ff4ff0097d5b#reply-641475ddaeaf57bb77b15709)

You might want to start reaching for a touch of JavaScript. It probably could be done without, but the complexity starts to make the tradeoff not make sense to avoid JS for the sake of avoiding JS. The JavaScript would listen for a click on your close icon and then remove the `open` attribute from the details DOM element.
