views:

62

answers:

1

Hi ol, am having a WYSIWYG textarea which i would like to copy the text (as-plane) and insert it to another textarea on the same form as plane text using javascript..............HELP! :-)

A: 

You could try using the innerHTML property. A sample code:

<script language="javascript">
document.getElementById('newArea').innerHTML = document.getElementById('oldArea').innerHTML;
</script>

Where "newArea" is the textarea to copy to and "oldArea" the textarea to copy from.

John Riche
am new to these stuff so bare with my 'simple questions'....this i what i have....function Change{document.getElementById('textCopied').innerHTML = document.getElementById('welcomeEmail').innerHTML;}<? //this is where i called the function with the onclick event?><input name="copyText" type="button" value="Copy Text" onclick="Change();" />
deadboy
This looks fine. What is the problem ?
John Riche