gpt4 book ai didi

jquery - 获取iframe内的radio值

转载 作者:行者123 更新时间:2023-12-01 00:42:07 26 4
gpt4 key购买 nike

我该如何使用 jQuery 来完成此操作?

基本结构:

<form id="myForm">
<iframe>
<!-- Normal HTML headers omitted -->
<input type=radio name="myRadio" value=1>First
<input type=radio name="myRadio" value=2>Second
<input type=radio name="myRadio" value=3>Third
</iframe>
<input type=button value="Submit" />
</form>

我尝试了网上的各种示例,例如

$("input[@type=radio][@checked]");

但是失败了。即使使用 jQuery 表单插件的 .fieldValue()失败。

最佳答案

尝试 $('#myForm iframe').contents().find('input[name=myradio]').val()

我假设 iframe 内容已经加载并且可以访问,例如相同的域。

关于jquery - 获取iframe内的radio值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/198024/

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