Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Manipulando Elementos por ID (JavaScript)</title>
- <script>
- function ChangeFrame(FrameSet)
- {
- switch(FrameSet)
- {
- case 0: document.getElementById('FrameTest').src = "http://www.baixaki.com.br"; document.getElementById("getSite").innerHTML = "Baixaki"; break;
- case 1: document.getElementById('FrameTest').src = "http://pastebin.com/u/garfield"; document.getElementById("getSite").innerHTML = "Paste Bin"; break;
- case 2: document.getElementById('FrameTest').src = "http://www.facebook.com/"; document.getElementById("getSite").innerHTML = "FaceBook"; break;
- case 3: document.getElementById('FrameTest').src = "http://www.ocioso.com.br/"; document.getElementById("getSite").innerHTML = "Ocioso"; break;
- }
- return 1;
- }
- </script>
- </head>
- <body>
- <a href='javascript: ChangeFrame(0)'>Página 1</a><br />
- <a href='javascript: ChangeFrame(1)'>Página 2</a><br />
- <a href='javascript: ChangeFrame(2)'>Página 3</a><br />
- <a href='javascript: ChangeFrame(3)'>Página 4</a><br />
- <font size='5'><strong>Você está visitando: </strong> <a id='getSite'> </a> <br /> </font>
- <iframe id='FrameTest' src='lol.html' width="1000" height="1000px" />
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement