How to deal with the div click event
Today, the editor will share with you the relevant knowledge points about how to deal with div click events. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.
The first method is to add onclick directly to div
Click
Second, DOM0 level event handling
VaroDiv=document.getElementById ("div")
ODiv.onclick=function () {
Alert ("success")
}
These are all the contents of this article entitled "how to deal with div Click events". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.