Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Button or Link That Changes Page in Iframe

I wish to make a link or button in a page that changes the page the iframe is on. It would be a local page:

idreesinc.com/iframe.html

and you can see what I have already here:

idreesinc.com/research

Help would be much appreciated as i have been looking for an answer for ages. Thanks!

like image 363
user1373771 Avatar asked May 09 '12 22:05

user1373771


People also ask

How do you add a link to an iframe?

You can embed an iframe in a page that is inside another iframe on another web page. When you set the target attribute to _parent, the link will open in the web page that is holding the iframe. In most situations with iframes, this target will open links in the same way that the _parent target does.

How do I make a clickable button open another page in HTML?

In HTML, a button link to another page can be by using the <a> tag, <input> tag, and the <form> tag. A link on a button is get by href=”” attribute of <a> tag. The “type=button” and “onclick=link” attributes are used to create a link on the button.


1 Answers

You can simply make an link with its target to the iframe name as follows:

<iframe name="demo" src="example.php"></iframe>

Your link in the parent will be:

<a href="newpage.html" target="demo">Change Link</a>
like image 108
ofermc Avatar answered Oct 15 '22 21:10

ofermc