当前位置:网站首页>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
边栏推荐
- 可以接收多種數據類型參數——可變參數
- TP5 where query one field is not equal to multiple values
- Creating wechat voucher process with PHP
- 荐读 | 分享交易员的书单,向名家请教交易之道,交易精彩无比
- Laravel's own paging query
- 《C语言程序设计》(谭浩强第五版) 第9章 用户自己建立数据类型 习题解析与答案
- LNMP MySQL allows remote access
- What kind of experience is it to prepare for a month to participate in ACM?
- 研讨会回放视频:如何提升Jenkins能力,使其成为真正的DevOps平台
- Vs code setting line feed
猜你喜欢

ASP. Net 6 middleware series - Custom middleware classes

Blazor University (11)组件 — 替换子组件的属性

LNMP MySQL allows remote access

2022a special equipment related management (elevator) work license question bank and simulation examination

TP5 customization in extend directory succeeded and failed. Return information

Web Course Design - his system

It can receive multiple data type parameters - variable parameters

Blazor University (11) component - replace attributes of subcomponents
![General testing technology [1] classification of testing](/img/f1/d80b6793b6443cbc4048d7e6319f51.png)
General testing technology [1] classification of testing

be based on. NETCORE development blog project starblog - (1) why do you need to write your own blog?
随机推荐
Data mining series (3)_ Data mining plug-in for Excel_ Estimation analysis
Xutils3 corrected a bug I reported. Happy
Iotos IOT middle platform is connected to the access control system of isecure center
2022A特种设备相关管理(电梯)上岗证题库及模拟考试
Blazor University (11)组件 — 替换子组件的属性
2022山东省安全员C证上岗证题库及在线模拟考试
The whole network is the most complete. How to do interface automation test? Proficient in interface automation test details
由于3²+4²=5²,所以称‘3,4,5‘为勾股数,求n(包括n)以内所有勾股数数组。
2022g2 boiler stoker examination question bank and online simulation examination
Laravel new route file
Recommend reading | share the trader's book list and ask famous experts for trading advice. The trading is wonderful
[MySQL] left function | right function
Use of ADB command [1]
一文了解全面静态代码分析
Fight leetcode again (290. Word law)
What kind of experience is it to prepare for a month to participate in ACM?
编码电机PID调试(速度环|位置环|跟随)
Xamarin effect Chapter 21 expandable floating operation button in GIS
2022 Shandong Province safety officer C certificate work certificate question bank and online simulation examination
C语言实现通讯录----(静态版本)