I wanna write some script; but something just doesn’t work. I’ll try to be as short as possible;
[CODE]
[COLOR=”Navy”]<html>[/COLOR]
[COLOR=”navy”]<head>[/COLOR]
[COLOR=”Magenta”]<style[/COLOR] [COLOR=”Sienna”]type=[/COLOR][COLOR=”Blue”]”text/css”[/COLOR][COLOR=”magenta”]>[/COLOR]
[COLOR=”magenta”]iframe.iFrmMain[/COLOR]
[COLOR=”magenta”]{[/COLOR]
display[COLOR=”Magenta”]:[/COLOR] [COLOR=”Blue”]none[/COLOR][COLOR=”magenta”];[/COLOR]
[COLOR=”magenta”]}[/COLOR]
[COLOR=”Magenta”]</style>[/COLOR]
[COLOR=”Red”]<script[/COLOR] [COLOR=”Sienna”]language=[/COLOR][COLOR=”Blue”]”javascript”[/COLOR] [COLOR=”Sienna”]type=[/COLOR][COLOR=”Blue”]”text/javascript”[/COLOR][COLOR=”red”]>[/COLOR]
[B]var[/B] txt [COLOR=”Blue”]= ‘click <a href=”#” onclick=”LnkClicked();”>here</a>’ [/COLOR] ;
[B]function[/B] LnkClicked[B][COLOR=”Navy”]() {[/COLOR][/B]
[COLOR=”DarkRed”]document.[/COLOR]getElementById([COLOR=”Blue”]’iFMain'[/COLOR]).style.display [COLOR=”blue”]= ‘block'[/COLOR] ;
[COLOR=”darkred”]document.[/COLOR]getElementById([COLOR=”blue”]’iFMain'[/COLOR]).src [COLOR=”blue”]= ‘http://www.google.com'[/COLOR] ;
txt [COLOR=”blue”]= ‘welcome to Google'[/COLOR] ;
[B][COLOR=”navy”]}[/COLOR][/B]
[COLOR=”red”]</script>[/COLOR]
[COLOR=”navy”]</head>[/COLOR]
[COLOR=”navy”]<body>[/COLOR]
[COLOR=”Magenta”]<center>[/COLOR]
[COLOR=”Navy”]<p>[/COLOR][COLOR=”Red”]<script>[/COLOR][COLOR=”DarkRed”]document.[/COLOR][COLOR=”Olive”]write[/COLOR][B][COLOR=”Navy”]([/COLOR][/B]txt[B][COLOR=”navy”])[/COLOR][/B];[COLOR=”Red”]</script>[/COLOR][COLOR=”Navy”]</p>[/COLOR]
[COLOR=”navy”]<p><iframe id=[/COLOR][COLOR=”Blue”]”iFMain”[/COLOR] [COLOR=”Navy”]class=[/COLOR][COLOR=”blue”]”iFrmMain”[/COLOR] [COLOR=”navy”]width=[/COLOR][COLOR=”blue”]”902″[/COLOR] [COLOR=”navy”]height=[/COLOR][COLOR=”blue”]”450″[/COLOR]>[COLOR=”navy”]</iframe></p>[/COLOR]
[COLOR=”Magenta”]</center>[/COLOR]
[COLOR=”navy”]</body>[/COLOR]
[COLOR=”navy”]</html>[/COLOR]
‘txt’-variable changes its value but what to do to change the text referenced to ‘txt’-variable in document body too?