Hi all,
I have small issue with the below javascript code. I am trying to create a button which copies the text of one field into another text area. This works fine at the moment but now I want to copy the text into the textarea instead of overwrite the value which was entered previously. Any idea how to do this?
<html>
<body>
Field1: <input type=”text” id=”field1″ value=”Hello World!” />
<br />
<textarea name=”suggestions” rows=”5″ cols=”25″ id=”field2″></textarea>
<br /><br />
Click the button to copy the content of Field1 to Field2.
<br />
<button onclick=”document.getElementById(‘field2’).value=document.getElementById(‘field1’).value”>Copy Text</button>
</body>
</html>