gpt4 book ai didi

javascript - 为什么这一行 JS 在 Firefox 中不起作用?

转载 作者:行者123 更新时间:2023-11-28 11:13:51 25 4
gpt4 key购买 nike

http://jsfiddle.net/Gch83/

<input id="myRadioButton1" name="radiobutton" value="radiobutton" type="radio">1
<input id="myRadioButton2" name="radiobutton" value="radiobutton" type="radio">2

<input value="1 checked" onMouseOver="document.all.myRadioButton1.checked = true;" type="button">
<input value="2 checked" onMouseOver="document.all.myRadioButton2.checked = true;" type="button">

将鼠标悬停在按钮上会更改 Chrome 中的单选按钮,但不会更改 Firefox。

这是为什么?

最佳答案

Don't Use document.all相反,使用 document.getElementById() 应该可以解决问题!

关于javascript - 为什么这一行 JS 在 Firefox 中不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7465622/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com