我有一个代码段,可在包含许多radio buttons
的网页中选择3个特定的radio buttons
。我在同一网页上打开了100个标签,并且只想运行一个摘要即可在所有标签上选择这些radio buttons
。
找不到任何方法。
代码段代码为:
document.getElementById("DataList_AbuseTypeRadioButtonList_0_7_0").checked = true;
document.getElementById("DataList_AbuseTypeRadioButtonList_1_7_1").checked = true;
document.getElementById("DataList_AbuseTypeRadioButtonList_2_7_2").checked = true;
目前,我必须在每个选项卡上打开控制台并运行此代码段。我只想执行一次,所有选项卡中的那三个radio buttons
应该会自动被选择。
注意:所有网页都有相同的URL。
下面的链接可以为您提供有关浏览器默认提供的DEV工具的基本信息。
https://developers.google.com/web/tools/chrome-devtools/javascript/snippets
如果还不够,那么您必须尝试对浏览器扩展进行编码。