Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello guys here i have inputs
XML
<table>
  <tr>
   <td>
   Name:
   </td>
   <td>
    <input id="Name" type="text" ></input>
   </td>
  </tr>
  <tr>
   <td>
   Age:
   </td>
   <td>
    <input id="Age" type="text" ></input>
   </td>
  </tr>
  <tr>
   <td>
   City:
   </td>
   <td>
    <input id="City" type="text" ></input>
   </td>
  </tr>
 </table>


and i want to add those input text into a table in a form of row
so for that i use

XML
<div id="cloneEle">
  <tr id="TrcloneEle">
   <td>
   <span id="DisName"></span>
   </td>
   <td>
    <span id="DisAge"></span>
   </td>
   <td>
    <span id="Discity"></span>
   </td>
  </tr>
 </div>


clone it but i didn't get idea how i can insert input controls value into span text area so please guys plz me.
Posted

1 solution

Try this:

JavaScript
$('#DisName').text($('#Name').val());
$('#DisAge').text($('#Age').val());
$('#Discity').text($('#City').val());
 
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