---
title: "Discussion on \"How to close popup when clicking outside it using JavaScript\" | Hashnode"
description: "Discussion on \"How to close popup when clicking outside it using JavaScript\". Make your web app feel more like a PWA"
url: "https://hashnode.com/posts/how-to-close-popup-when-clicking-outside-it-using-javascript/6391a6e9aec36caa5fd1cc93"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to close popup when clicking outside it using JavaScript](https://madsakselsen.hashnode.dev/how-to-close-popup-when-clicking-outside-it-using-javascript?utm_source=hashnode&utm_medium=feed)

Make your web app feel more like a PWA

Dec 8, 2022 · 6 min read · madsakselsen.hashnode.dev  
Read the article

-   [#popup](https://hashnode.com/tag/popup)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#overlay](https://hashnode.com/tag/overlay)
-   [#css](https://hashnode.com/tag/css)
-   [#html5](https://hashnode.com/tag/html5)

## Written by

[Mads Akselsen](https://hashnode.com/@MadsAkselsen)

@MadsAkselsen · Copenhagen, Denmark

  
[View profile](https://hashnode.com/@MadsAkselsen)

Web Development

I am a developer currently working as a Software Engineer at A.P. Moller - Maersk

## Responses 1

Markdown supported · ⌘↵ to post

[Mohammed Sharooque](https://hashnode.com/@sharooque)

[Dec 8, 2022](https://hashnode.com/posts/how-to-close-popup-when-clicking-outside-it-using-javascript/6391a6e9aec36caa5fd1cc93/comment/6391c1ba120246e215ffb61a)

Great share!

[Mads Akselsen](https://hashnode.com/@MadsAkselsen)

[Dec 8, 2022](https://hashnode.com/posts/how-to-close-popup-when-clicking-outside-it-using-javascript/6391a6e9aec36caa5fd1cc93/comment/6391c1ba120246e215ffb61a#reply-6391c2950771b6e5cf4a7cf7)

Eyy, appreciate it! :)
