Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to copy the text area content to another text area in html jquery
Posted
Updated 21-Jul-14 4:45am
v2
Comments
Sergey Alexandrovich Kryukov 21-Jul-14 10:43am    
If this is jQuery, why the tag is PHP?! What's so difficult? You can find thousands answers to this question.

What have you tried so far?

—SA

JavaScript
$('secondTextArea').html($('firstTexrArea').html());
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 21-Jul-14 10:58am    
5ed.
—SA
Thanks Sergey. :)
Santosh K. Tripathi 22-Jul-14 1:22am    
+5
Thanks a lot S.K.Tripathi. :)
jquery code

$("#readdcopy").click(function(){
$('#shiadd').html($('#readd').html());
});

html code

XML
<tr>
   <td align="right" bgcolor="#f7f7f9">Registered Addresss: </td>
   <td><textarea name="readd" id="readd" class="smtext"></textarea><br /><a href="#" id="readdcopy">Copy Shipping Address</a></td>
   <td align="right" bgcolor="#f7f7f9">Shipping Address: </td>
   <td><textarea name="shiadd" id="shiadd" class="smtext"></textarea><br /><a href="#" id="shiaddcopy">Copy Registered Address</a></td>
 </tr>
 
Share this answer
 
it is not done

jquery code

$("#readdcopy").click(function(){
$('#shiadd').html($('#readd').html());
});

html code

XML
<tr>
   <td align="right" bgcolor="#f7f7f9">Registered Addresss: </td>
   <td><textarea name="readd" id="readd" class="smtext"></textarea><br /><a href="#" id="readdcopy">Copy Shipping Address</a></td>
   <td align="right" bgcolor="#f7f7f9">Shipping Address: </td>
   <td><textarea name="shiadd" id="shiadd" class="smtext"></textarea><br /><a href="#" id="shiaddcopy">Copy Registered Address</a></td>
 </tr>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900