function arrayData() { debugger; var employee = []; employee = [{ Id: 1, Name: "Harshal", Age: 22 } , { Id: 2, Name: "Bill", Age: 44 } , { Id: 3, Name: "Thomas", Age: 32 } , { Id: 4, Name: "Austin", Age: 56}]; //records get show in Textbox inside the Cells for (var index = 0; index < employee.length; index++) { $("#tbNames tr:last").after("<tr><td>" + employee[index].Id + "</td> <td>" +<input id="nameTextBox" type="text" value="+employee[index].Name+" /> + "</td> <td>" + <input id="ageTextBox" type="text" value="employee[index].Age" /> + "</td> </tr>"); } } <pre lang="html"> </script> <p> The Below Button will Fill the Data</p> <button id="clickButton"> CLICK</button> <table id="tbNames" border="1"> <tr> <th> ID </th> <th> NAME </th> <th> AGE </th> </tr> <!-- <tr> <td> put value here </td> </tr>--> </table>
Array
for (index = 0; index < employee.length; index++) { $("#tbNames tr:last").after("<tr><td>" + employee[index].Id + "</td><td>" + employee[index].Name + "</td><td>" + employee[index].Age + "</td></tr>"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)