0

I have a website that I host but the server belongs to 000webhost. at the bottom there is a div element with a class of disclaimer that has a short sentence regarding the war in Ukraine. I didnt mind it until I tried making my site a extension via Iframe and found out that the "disclaimer" takes up the majority of the space. I tried using W3 school's template to remove it but it hasnt worked. here is my code:

<iframe id="myFrame" src="https://mytinyserver.000webhostapp.com/" ></iframe>


<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
  var iframe = document.getElementById("myFrame");
  var elmnt = iframe.contentWindow.document.getElementsByClassName("disclaimer")[0];
  elmnt.style.display = "none";
}
</script>
  • 1
    Does this answer your question? [Using CSS to affect div style inside iframe](https://stackoverflow.com/questions/583753/using-css-to-affect-div-style-inside-iframe) – evolutionxbox May 09 '22 at 15:14
  • If the site is in a different domain you can not touch it from the parent. – epascarello May 09 '22 at 15:16
  • To change the content of the iframe you need a content script running there with "all_frames": true. – wOxxOm May 09 '22 at 16:44
  • @epascarello I could remove it with the inspect element so I thought it was removable via the w3 method – Alex Aguillon May 09 '22 at 18:21
  • here is the link to the template I used: [link](https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_element_iframe) – Alex Aguillon May 09 '22 at 18:23

0 Answers0