how can i set the src property of iframe using javascirpt

I have asp.net 1.1 web form and in that i am using Iframe
now i want to set src property of Iframe using javascript
so wht i want is when user clicks on a button then i want to call this javascript function which i will set src property of the page and then user can see the page in iframe
so how can i set the src property of iframe using javascirpt
ziorrinfotechAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
thirdConnect With a Mentor Commented:
try,

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<iframe name="myframe" src="" width="100%" height=""></iframe>
<form name="frm1" method="post" action="" onsubmit="return ">
<input type="text" name="txt1" value="http://www.google.com">
<input type="button" value="Go" onclick="document.frames['myframe'].location=this.form.txt1.value;">
</form>
</body>
</html>
0
 
HuyBDCommented:
try

parent.nameofiframe.window.location.href="";

HuyBD;
0
 
ziorrinfotechAuthor Commented:
hi HuyBD
it does not work
0
 
Michel PlungjanIT ExpertCommented:
window.frames, third...
0
 
thirdCommented:
yes, you are right. why did I do that? ;-) getting rusty everytime I handle another language...
0
All Courses

From novice to tech pro — start learning today.