JRS: In article <47************@individual.net>, dated Wed, 8 Mar 2006
12:04:18 remote, seen in news:comp.lang.javascript, Gernot Frisch
<Me@Privacy.net> posted :
<body>
<form name="Input">
<textarea name="text_in" style="width:100%; height:40%">Sample
text</textarea>
<br>
<div id=b
onclick="document.getElementById('preview').inner HTML=document.Input.text_in.val
ue">
</div>
</form>
<div id="preview">
</div>
<script language="Javascript">
var elapse = 1000; // this is interval - 1000 millisecond
function onTimer()
{
document.getElementById('preview').innerHTML=docum ent.Input.text_in.value;
timer = window.setTimeout("onTimer()",elapse);
}
onTimer();
</script>
</body>
I suspect the onClick is redundant; and it might be better to call the
function with body onLoad.
If the HTML may include controls, and data should be put by the user
into the controls for test, then ISTM necessary to be able to turn off
the function, for otherwise the controls will probably be continually
reinitialised.
See also <URL:http://www.merlyn.demon.co.uk/js-quick.htm>, to which I
might add such a feature.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.