Click outside div to hide div in pure JavaScript

前端 未结 6 1552
栀梦
栀梦 2020-12-11 02:50

I want to make a popup that should appear once a button is clicked and disappear once the user clicks outside of the box.

I\'m not sure how to make the div disappear

6条回答
  •  死守一世寂寞
    2020-12-11 03:29

    hope this will work for you

     
    

    This code is tested and it's working nicely, thank you.

提交回复
热议问题