농장/HTML5·CSS

[ HTML / JS ] Iframe 활용

귤발자 2020. 2. 15. 16:28
728x90
반응형

코드

<body align="center">

<script>
    function loadHome(){
        document.getElementById("tistory-home").src = 'https://we-always-fight-with-code.tistory.com/';
    }
</script>

<h2>Iframe 활용</h2>

<iframe height="400px" width="100%" id="tistory-home" style="border: 2px dotted orange;"></iframe>

<p>
    <button onclick="loadHome()">군고구마말랭이의 티스토리 홈으로 이동</button>
</p>

</body>​

 


 

실행

 

Iframe 활용

 




728x90
반응형