第一个办法:
index.htm代码:
<iframe src=1.htm></iframe>
<span id=spanid></span>
1.htm代码:
<select onchange="parent.document.all.spanid.innerText=this.options[this.selectedIndex].value">
<option selected value=1>1</option>
<option value=2>2</option>
</select>

解决方案 »

  1.   

    我需要反过来访问,只能是在主窗口中主动去获取iframe中select的值,特殊需要。
      

  2.   

    document.iframeName.document.formName.selectName.value
      

  3.   

    不行啊,是不是iframe还没有加载,所以才出错。
      

  4.   

    main.htm
    ----------
    <iframe name=ifrm src=2.htm></iframe>
    <input type=button onclick="alert(ifrm.document.form1.s.value)">2.htm
    --------
    <body>
    <form name=form1>
    <select name=s>
    <option value=1>1
    <option value=2>2
    <option value=3>3
    </select>
    </form>
    </body>