I'm attempting to toggle the visibility of certain page elements based on whether the page is loaded in an iframe.
<script>this.top.location !== this.location && (this.top.location = this.location);</script>
The above code successfully breaks out of the iframe, however,
<script>this.top.location !== this.location && (document.getElementById("toolbar").style.display="none");</script>
fails to hide the div with the id "toolbar". What could be causing this issue? (My knowledge of javascript is quite limited). Thanks in advance.