While this works in IE I just cant get it to work in Firefox. Any changes in the textarea are not passed on when you click the ‘doit’ button and the ‘addTxt’ button only works once. How can I get the ‘doit’ button to display the text entered into the textarea?
<html>
<head>
<script type="text/javascript">
<!--
function addTxt(){
document.getElementById("ta").innerHTML = 'Some New Text';
document.getElementById("p1").innerHTML = '';
}
function doit(){
var txt = document.getElementById("ta").innerHTML;
document.getElementById("p1").innerHTML = txt;
}
//-->
</script>
</head>
<body>
<input type="button" value="addTxt" onclick="addTxt()">
<br>
<textarea name="ta" id="ta" rows="2" cols="15">Txt</textarea>
<br>
<input type="button" value="doit" onclick="doit()">
<br>
<p name="p1" id="p1"></p>
</body>
</html>
Thanks for any help. I have been experimenting with all kinds of variations but just cant get it to work. Is there some way of refreshing the textarea element without having to refresh the whole page?