Hello I am trying to update the src of an iframe with javascript, below is the code I am trying. When I try to execute the code it fails as if an error occured, and stops executing code when I call this line.
document.getElementById('logviewer').src = "www.yahoo.com";
Example code:
<iframe src="" id="logviewer"/>
<script type="javascript/text">
document.getElementById('logviewer').src = "www.yahoo.com";
alert('Loaded Yahoo');
</script>
You can see the src doesn't change and the alert doesn't show.
Thanks ahead of time for your answers!