简体   繁体   中英

How to show and hide pop up onclick in pure javascript?

i have a pop up class called "query-pop-up", i want to show and hide popup onclick in pure js. How to achicve that.

SHould i use addEverntListerner, or somethinge else.

Please let me know using this.

I'm pretty new to Javascript myself, but from what I understand in your question, it seems that you are doing some form of web design and are likely also using HTML and CSS.

You could probably use an addEventListener method, but I think the jquery toggle method would be more convenient because it allows you to 'toggle' between hide and show for all elements. Without further detail, I can't really recommend a specific implementation, but I would suggest to check out the following links:

Hope I was somewhat helpful: Good luck! :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM