其他分享
首页 > 其他分享> > 升级版html框架配置

升级版html框架配置

作者:互联网

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <a id="one">demo</a>
    <a id="two">time</a>
    <br>

    <iframe src="demo.html#demo" id="iframe_a" name="iframe_a" width="800" height="400" ></iframe>
    <iframe src="time.html#time" id="iframe_b" name="iframe_b" width="800" height="400" style="display: none;"></iframe>


    <script type="text/javascript">
        document.getElementById("one").onclick=function(){
            document.getElementById("iframe_a").style.display='block'
            document.getElementById("iframe_b").style.display='none'
        }

        document.getElementById("two").onclick=function(){
            document.getElementById("iframe_a").style.display='none'
            document.getElementById("iframe_b").style.display='block'
        }
    </script>
</body>
</html>

 

标签:function,style,框架,display,getElementById,html,iframe,document,升级版
来源: https://www.cnblogs.com/johnzhao/p/16256006.html