当前位置:网站首页>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
边栏推荐
- [Mysql] LEFT函數 | RIGHT函數
- First in the binary tree
- Use of metagroup object tuple in C
- Laravel8- use JWT
- ASP. Net 6 middleware series - execution sequence
- A set of combination boxing to create an idea eye protection scheme
- 建立与遍历二叉树
- “如何实现集中管理、灵活高效的CI/CD”在线研讨会精彩内容分享
- Source generator actual combat
- 准备一个月去参加ACM,是一种什么体验?
猜你喜欢

2022G2电站锅炉司炉考试题库及在线模拟考试

宁德时代地位不保?

Impact of AOT and single file release on program performance

C# 读写二进制文件

C language to achieve address book - (static version)

Web Course Design - his system

2022g2 boiler stoker examination question bank and online simulation examination

全网最全,接口自动化测试怎么做的?精通接口自动化测试详解

《C语言程序设计》(谭浩强第五版) 第8章 善于利用指针 习题解析与答案

软件测试相关知识~
随机推荐
It can receive multiple data type parameters - variable parameters
Data mining series (3)_ Data mining plug-in for Excel_ Estimation analysis
【VS Code】解决jupyter文件在vs code中显示异常的问题
一套组合拳,打造一款 IDEA 护眼方案
General testing technology [1] classification of testing
C语言实现通讯录----(静态版本)
C read / write binary file
Mysql database
2022年P气瓶充装培训试题及模拟考试
編碼電機PID調試(速度環|比特置環|跟隨)
. net tip: talk about the problem that the scoped service cannot be obtained in the middleware structure
2022A特种设备相关管理(电梯)上岗证题库及模拟考试
Source Generator实战
求二叉树的叶子结点个数
Use split to solve the "most common words" problem
C introduction of variable parameter params
[MySQL] left Function | Right Function
2022年做跨境电商五大技巧小分享
If the deep replication of objects is realized through C #?
The most detailed in the whole network, software testing measurement, how to optimize software testing cost and improve efficiency --- hot