用js从一个框架(frame)调用另一个框架(frame)的内容

1.frame.html

 

<frameset id="fr" rows="50%,50%">
      
<frame name="up" id="up" src="u.html"/>
      
<frame name="down" id="down" src="d.html"/>
</frame>

 


2.u.html

 

代码
<html>
<head>
<script>
function test()
{
  
var objValue=window.parent.frames["down"].document.getElementById("456");
  alert(objValue.value);
}

</script>
</head>
<body>
<input id="123" type="button" value=" 测 试 " onclick="test();"/>
</body>
</html>

 


3.d.html

 

<html>
<head>
</head>
<body>
  <input id="456" type="text" value="456"/>
</body>
</html>

 

 

相关文章:

  • 2021-06-11
  • 2021-12-03
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
  • 2021-06-10
  • 2021-10-28
  • 2021-10-11
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2021-12-03
  • 2021-12-03
  • 2021-12-03
  • 2021-12-03
  • 2021-12-03
相关资源
相似解决方案