Can anyone tell me why the following bit of code doesn't work in Netscape
(6) but does in IE6 ?
It is just an example which is supposed to toggle some text in both the
<textarea> and <p> elements but what happens in Netscape is that the
<textarea> seems to get overwritten rather than written to whereas the <p>
element is just written to or removed.
-------Problem code-----
<html>
<script language='JavaScript'>
var on = false;
function fill_text() {
if(!on) {
document.getElementById('test1').innerHTML="Testin g";
document.getElementById('test3').innerHTML="Hello" ;
on= true;
}
else {
document.getElementById('test1').innerHTML="";
document.getElementById('test3').innerHTML="";
on= false;
}
</script>
<body>
<textarea name='test1' id='test1'></textarea>
<p name='test3' id='test3'></p>
<button name='test2' id='test2' onclick='fill_text();'>Do It</button>
</body>
</html>
----End problem code------------
Thanks for any help
Martin.