菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小鸟启蒙(facesoho.com)</title> </head> <body> <p>点击按钮修改第一个 iframe 的 src 值 (索引为 0)。</p> <button onclick="myFunction()">点我</button> <br><br> <iframe src="http://c.facesoho.com"></iframe> <iframe src="http://m.facesoho.com"></iframe> <script> function myFunction() { window.frames[0].location = "http://www.facesoho.com"; } </script> </body> </html>
运行结果