No JavaScript, just modern browser magic, thanks to the wonderful folks speccing for the web and building our browsers!
Closed with just HTML via <form method="dialog">, opened with the popover attribute.
<form method="dialog">
popover
show-popover opens this and hide-popover closes it!
show-popover
hide-popover