I have a simple JavaScript code:
<script type="text/javascript">
function openWindow() {
var mywindow = window.open("file.html");
mywindow.document.getElementById("foo").innerHTML="Hey you!!";
}
</script>
This function is called with the onclick event. The window opens fine, but the innerHTML element does not change. This is the file that I have, so I know that I am not blocked by any security policy, and the element with id 'foo' definitely exists. (This is a DIV). I tried other .innerHTML options like .src and .value but nothing works. Anyone have any suggestions?
source
share