window.frames["source"].document.getElementById(name).value="1"

解决方案 »

  1.   

    window.frames["source"].document.getElementById("txt1").value="1";
      

  2.   

    source.document.getElementById("txt1").value="1";
      

  3.   

    window.frames["source"].contentWindow.document.getElementById(name).value = 1;
      

  4.   

    不好意思这个写错了。
    如果是window.frames["source"]就不用加contentWindow
    如果是document.getElementsByTagName("source")[0]就要加contentWindow
      

  5.   

    我的调用代码
    <iframe name="aaa" id="baiduframe" marginwidth="0" marginheight="0" scrolling="no"
      framespacing="0" vspace="0" hspace="0" frameborder="0" width="400" height="90" 
      src="http://unstat.baidu.com/bdun.bsc?tn=ksyy2000_pg&cv=0&cid=1236266&csid=242&bgcr=ffffff&ftcr=000000&urlcr=0000ff&tbsz=335&sropls=1,2,3,4,5,6&defid=2&kwgp=0">
    </iframe>
    想把里面 “请输入关键字” 改成其他的 按照大家的方法是拒绝访问。请问究竟能不能实现修改?