Javascript Detect click event outside of div

前端 未结 10 965
孤城傲影
孤城傲影 2020-11-27 06:07

I have a div with id=\"content-area\", when a user clicks outside of this div, I would like to alert them to the fact that they clicked outside of it. How would I use JavaSc

10条回答
  •  一个人的身影
    2020-11-27 06:48

    Put this into your document:

    
    

提交回复
热议问题