当前位置:网站首页>js 中,为一个里面带有input 的label 绑定事件后在父元素绑定单机事件,事件执行两次,求解
js 中,为一个里面带有input 的label 绑定事件后在父元素绑定单机事件,事件执行两次,求解
2022-04-23 03:15:00 【JavaTestZhangy】
改变下思路,我的是,把事件绑定到input上面,解决问题,然后使用for 标签指向input元素
<li class="option" >
<input type="radio" id="inputid"/>
<label for="inputid">点击label,和点击inpu效果 一样</label>
</li>
$('li.option input').click(function() {
alert("只会执行一次")
});
版权声明
本文为[JavaTestZhangy]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_23490959/article/details/100152619
边栏推荐
- ASP. Net 6 middleware series - conditional Middleware
- C syntax sugar empty merge operator [?] And null merge assignment operator [? =]
- Test experience data
- 交换二叉树中每个结点的左和右
- Charles uses three ways to modify requests and responses
- . net tip: talk about the problem that the scoped service cannot be obtained in the middleware structure
- A set of combination boxing to create an idea eye protection scheme
- Student achievement management
- 搭建XAMPP时mysql端口被占用
- 編碼電機PID調試(速度環|比特置環|跟隨)
猜你喜欢
![General testing technology [1] classification of testing](/img/f1/d80b6793b6443cbc4048d7e6319f51.png)
General testing technology [1] classification of testing

C WPF UI framework mahapps switching theme

The most understandable life cycle of dependency injection

be based on. NETCORE development blog project starblog - (1) why do you need to write your own blog?

“如何实现集中管理、灵活高效的CI/CD”在线研讨会精彩内容分享
![[untitled]](/img/b5/6ce72422bbf330610c747ceb482944.jpg)
[untitled]

类似Jira的十大项目管理软件

C语言实现通讯录----(静态版本)

编码电机PID调试(速度环|位置环|跟随)
![Eight elder brothers chronicle [4]](/img/87/f695d0275f8a66b9def48a75668d15.png)
Eight elder brothers chronicle [4]
随机推荐
General test technology [II] test method
Creating wechat voucher process with PHP
Find the number of leaf nodes of binary tree
“如何实现集中管理、灵活高效的CI/CD”在线研讨会精彩内容分享
JSON related
全网最全,接口自动化测试怎么做的?精通接口自动化测试详解
手机连接电脑后,QT的QDIR怎么读取手机文件路径
TP5 inherits base and uses the variables in base
C language to achieve address book - (static version)
Fight leetcode again (290. Word law)
C syntax pattern matching [switch expression]
全网讲的最细,软件测试度量,怎样优化软件测试成本提高效率---火爆
General testing technology [1] classification of testing
The most detailed in the whole network, software testing measurement, how to optimize software testing cost and improve efficiency --- hot
Use DFS to solve the problem of "number of dictionary rows"
TP5 customization in extend directory succeeded and failed. Return information
12.<tag-链表和常考点综合>-lt.234-回文链表
Improvement of ref and struct in C 11
. net core current limiting control - aspnetcoreratelimit
先中二叉建树