JRS: In article <
[email protected]>, dated Wed, 8 Mar 2006
12:04:18 remote, seen in Gernot Frisch
<body>
<form name="Input">
<textarea name="text_in" style="width:100%; height:40%">Sample
text</textarea>
<br>
<div id=b
onclick="document.getElementById('preview').innerHTML=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=document.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.