在iframe中获取无线电值

sya*_*yaz 3 jquery jquery-plugins

我如何使用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>
Run Code Online (Sandbox Code Playgroud)

我从网上尝试过各种各样的例子

$("input[@type=radio][@checked]");
Run Code Online (Sandbox Code Playgroud)

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

red*_*are 11

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

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