Home > database >  Hyperlink inside iframe is not working when I click on the parent page
Hyperlink inside iframe is not working when I click on the parent page

Time:02-22

I have a hyperlink in iframe, when I click this on the parent page, is not working.

Here is an example set up:

iframe.html

<h1>I'm inner page!</h1>
<a id="shared"  href="pc.html" target="_top">go another page</a>

parent.html

<h1>I'm INDEX</h1>
<iframe id="open" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" src="iframe.html" width="100%" frameborder="0" border="0" cellspacing="0"></iframe>

please help me T__T

CodePudding user response:

just remove target attribute

<h1>I'm inner page!</h1>
<a id="shared"  href="pc.html">go another page</a>

see https://www.w3schools.com/tags/att_a_target.asp

  • Related