I want to be able to click a button on page1.html
and then have a new page (such as portal.html
) open up with an iframe with the URL specified in the iframe.
So, I want to have 2 pages. page1.html
, and portal.html
. The portal page would have an iframe on it, and I want the URL of that iframe to change based on what button I pressed on page1.html
.
For example, page1.html
would have 2 buttons, button1
and button2
.
- If I clicked button1, I would be sent to portal.html and have https://example.com in the iframe.
- If I clicked button2, I would be sent to portal.html and have https://stackoverflow.com in the iframe.
Is this possible, and if it is how can I do it? I would prefer to do it without any server side code such as PHP if possible.
edit
I will have 5 pages.
- index.html
- portal.html
- page1.html
- page2.html
- page3.html
Portal.html will have an iframe.
Index.html will have 3 buttons.
- If I click button1, I want to load the page portal.html (in a new tab) but with page1.html in the iframe (on portal.html)
- If I click button2 I want to load the page portal.html (in a new tab) but with page2.html in the iframe (on portal.html)
- If I click button3 I want to load the page portal.html (in a new tab) but with page3.html in the iframe (on portal.html)