I have this parent page with title Criatweb,
and an iframe page inside it,
I want to change the display of a div inside the iframe page, but to change only when it’s title is Criatweb.
I tried this in the iframe page but didn’t have success:
<script type="text/javascript">
if (window.parent.document.title == 'Criatweb')
{document.getElementById('customizarsite').style.display = 'none';}
</script>
The error message means you are calling it before the element is loaded on the page!
It is like walking through a door before opening it. Not going to happen unless you are a ghost.
You need to call it onload or onready or after the element.