当前位置:网站首页>Summary of binding events and precautions in JS
Summary of binding events and precautions in JS
2022-07-20 09:06:00 【Ares-Wang】
/*
In the work , All are project development , The methods used are optimal , Those most basic methods have been forgotten ,
Today, I want to sum up , Make a note of . Strengthening memory
DOM Three methods of event binding in
1、 The most basic and primitive
Bind in the tag element , Single quotation marks 、 Double quotation marks are OK () Don't forget it ,
2、 Commonly used in work The binding event stay js Code
3、 Event monitoring Most used in work Because you can listen to multiple events , above 1-2 Method cannot bind multiple events ,
The same thing , Events bound later Will overwrite previous events
Bind in row and column , If more than one , The code is too bloated , Poor readability , Adverse expansion
stay js In the code , adopt onXXXX= fn Method Cannot bind multiple events
adopt addEventListener(IE I won't support it ,IE Use attachEvent) Multiple events can be monitored , But consider browser compatibility , IE I have given up my browser kernel , Using Google kernel . This is exciting good news
边栏推荐
- Aggregate payment meets the needs of various industries to access a variety of payment channels
- Horizontal comparison between distributed transaction framework Seata and Hmily
- What is online banking payment
- 10A polkadot substrate : 节点指标
- 【无标题】mysql之binlog数据恢复流程
- MySQL binary solves the case sensitive problem of MySQL data
- What if I forget my MySQL password?
- 聚合支付滿足各行業接入多種支付通道
- 10o Polkadot substrate: develop smart contracts
- 上传本地jar包到线上私服
猜你喜欢
Crudapi add, delete, modify and check the successful case of interface zero code product: Chamber of Commerce Alliance card project
10e Polkadot substrate: configure contract tray
js缓冲运动
JWT+RSA 无状态SSO原理
Without programming, generate crud based on zero code of Oracle database, add, delete, modify and check restful API interface
支付宝支付和微信支付容易被风控可以看一下这个操作
Static library A documents and Framework file
Android Studio 执行 Kotlin 抛出 com.android.builder.errors.EvalIssueException 问题的解决方法
命令行反编译重打包
机器学习中数据集csv编码格式问题
随机推荐
104 polkadot substrate : 许可网络
Solving inverse matrix with C language
Aggregate payment meets the needs of various industries to access a variety of payment channels
Android studio executes kotlin throwing com android. builder. errors. Solution to evalissueexception problem
What if I forget my MySQL password?
Static library A documents and Framework file
What are the three-party payment companies?
在线支付,出款和收款
什么是网银支付
手写一个AIDL
哈希桶的应用
Introduction to two core functions of access aggregation
常见的几种锁(互斥锁,自旋锁,乐观锁,悲观锁)
Les paiements groupés répondent aux besoins de toutes les industries pour accéder à divers canaux de paiement
100 JD navigation bar slot usage flexible layout (display: flex;)
技术文章汇总
说说如何安装 Openfire
线上问题定位之一——arthas
Advantages of aggregate collection code
MPPT power controller design