As you can see from the code, I have a div tag wich displays a set of vars. I'm looking to change the content of the vars, and update the div in one operation. Thus the "changetext" button. But I've looked everywhere, and can't seem to get info on how to refresh the div without refreshing the entire page, thus loosing the updated vars.
Any help would be much appreciated. I'm also open to different ways of doing this.
---------------------------------------------------
var text1="Much to learn have you, young padawan. ";
var text2="If a Jedi wish you to become";
var text3="In a galaxy far far away. ";
var text4="A group of rebels struggle against the migthy empire";
<div>
<h1><scriptlanguage="javascript">document.writelntext1);</script></h1>
<p><script language="javascript">document.writeln (text2);</script></p>
</div>
<inputype="button" value="Changetext" onclick="text1=tekst3; text2=text4;" >
--------------------------------------------------
Nobody enjoys shooting penguins, but if you have to shoot penguins, you might as well enjoy it.
Any help would be much appreciated. I'm also open to different ways of doing this.
---------------------------------------------------
var text1="Much to learn have you, young padawan. ";
var text2="If a Jedi wish you to become";
var text3="In a galaxy far far away. ";
var text4="A group of rebels struggle against the migthy empire";
<div>
<h1><scriptlanguage="javascript">document.writelntext1);</script></h1>
<p><script language="javascript">document.writeln (text2);</script></p>
</div>
<inputype="button" value="Changetext" onclick="text1=tekst3; text2=text4;" >
--------------------------------------------------
Nobody enjoys shooting penguins, but if you have to shoot penguins, you might as well enjoy it.