IFRAME – Command it to Change

[Total: 0    Average: 0/5]

This will show you how to use javascript to change the iframe content.

Head Code:

<script>
function doIt()
{
frames['ifr'].location.href=document.f1.link.value;
}
</script> 

Body Code:

<iframe name=ifr></iframe>
<form name=f1>
<input type=text name=link value="http://www.js-examples.com/">
<a href='javascript:doIt()'>Click Me</a>
</form>

Times Viewed: 10

Leave a Reply

Your email address will not be published. Required fields are marked *