-1

index.html

<html>
<head>
<title>Index</title>
</head>
<body>
<p>some text</p>
<a href="https://..." target="f">link</a>
<iframe name="f"></iframe>
</body>
</html>

Is it possible to hide the text inside p-tag once the target website is fully loaded inside the iframe?

Abhishek Roy
  • 73
  • 1
  • 3
  • 11

1 Answers1

0

Try this link for solution.

Modified link as per @Barmar comments.

HTML

<p id="removeText"> some text</p>
<iframe src="demo_iframe.htm" name="iframe_a" id="iframe_a"></iframe>
<a href="https://www.w3schools.com" target="iframe_a">W3Schools.com</a>

JS

document.getElementById('iframe_a').onload = function() {
   document.getElementById('removeText').innerHTML = '';
}
Akshay
  • 373
  • 1
  • 13