当前位置:网站首页>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
边栏推荐
- Load view Caton
- EasyUI's combobox implements three-level query
- C read / write binary file
- Peut recevoir plusieurs paramètres de type de données - paramètres variables
- be based on. NETCORE development blog project starblog - (2) environment preparation and creation project
- Swap the left and right of each node in a binary tree
- Xutils3 corrected a bug I reported. Happy
- Use split to solve the "most common words" problem
- Maui initial experience: Cool
- Miniapi of. Net7 (special section): NET7 Preview3
猜你喜欢
Laravel's own paging query
再战leetcode (290.单词规律)
IOTOS物联中台对接海康安防平台(iSecure Center)门禁系统
[vs Code] solve the problem that the jupyter file displays exceptions in vs code
The whole network is the most complete. How to do interface automation test? Proficient in interface automation test details
2022T电梯修理考试模拟100题及在线模拟考试
Vs code setting line feed
Ningde's position in the times is not guaranteed?
svg标签中利用<polygon/>循环数组绘制多边形
It can receive multiple data type parameters - variable parameters
随机推荐
Recommend reading | share the trader's book list and ask famous experts for trading advice. The trading is wonderful
“如何实现集中管理、灵活高效的CI/CD”在线研讨会精彩内容分享
A set of combination boxing to create an idea eye protection scheme
Use of slice grammar sugar in C #
TP5 customization in extend directory succeeded and failed. Return information
准备一个月去参加ACM,是一种什么体验?
Recursion - outputs continuously increasing numbers
Tencent video price rise: earn more than 7.4 billion a year! Pay attention to me to receive Tencent VIP members, and the weekly card is as low as 7 yuan
Ningde's position in the times is not guaranteed?
OLED多级菜单记录
2022年P气瓶充装培训试题及模拟考试
What kind of experience is it to prepare for a month to participate in ACM?
TP5 email (2020-05-27)
使用两种方法来解决“最大回文数乘积”问题
Maui initial experience: Cool
Source generator actual combat
Laravel8- use JWT
Miniapi of. Net7 (special section): NET7 Preview3
Flink实时数仓项目—DWS层设计与实现
7-11 重排链表 (25 分)