对于button按钮引发的bug

主要原因就是今天在给button按钮添加一个点击事件的时候,并没有声明button的type类型,就一直发生点击按钮但事件并不触发的问题。

触发这种问题的原因就是:

按钮默认的 type 类型是 "submit",而不是 "button"。当你不显式声明 type 属性时,浏览器会默认将按钮类型设为 "submit",这可能导致在一些情况下产生意外行为,如果不设置按钮的type类型,html页面会默认当成submit类型使用,如果没有指定from表单就默认提交到本页面

相关推荐
phantom_1114 天前
Cursor 分析 bug 记录
bug·cursor
Direction_Wind5 天前
Flinksql bug: Heartbeat of TaskManager with id container_XXX timed out.
大数据·flink·bug
AIBigModel8 天前
智能情趣设备、爆 bug:可被远程操控。。。
网络·安全·bug
Direction_Wind8 天前
flinksql bug: Received resultset tuples, but no field str
bug
远瞻。8 天前
【bug】diff-gaussian-rasterization Windows下编译 bug 解决
windows·bug
中草药z8 天前
【测试】Bug+设计测试用例
功能测试·测试工具·测试用例·bug·压力测试·测试
我又来搬代码了9 天前
【Android】【bug】Json解析错误Expected BEGIN_OBJECT but was STRING...
android·json·bug
葵野寺9 天前
【软件测试】BUG篇 — 详解
bug·测试
青青子衿越11 天前
微信小程序右上角分享页面找不到路径bug
微信小程序·小程序·bug
刘火锅12 天前
Bug 记录:SecureRandom.getInstanceStrong()导致验证码获取阻塞
spring boot·spring·spring cloud·bug