我该如何使用 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() http://malsup.com/jquery/form/#fields failed.
Try $('#myForm iframe').contents().find('input[name=myradio]').val()
我假设 iframe 内容已经加载并且可以访问,例如相同的域。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)