<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>add_tr</title>
<script src=‘jquery.js‘></script>
<script>
//create letter
var letterArr = [];
for(var i=65,j=0;i<91;i++,j++)
{
letterArr[j] = String.fromCharCode(i);
}
$(function(){
$(‘#btnok‘).on(‘click‘,function(){
alert($(‘input.add‘));
$(‘table:last‘).append(‘<tr>‘ + $(‘table tr:last‘).html() + ‘</tr>‘);
orderLine();
});
orderLine();
});
//defined add letter function
function orderLine(){
//get input where class eq add
$(‘input.add‘).each(function(i){
console.log($(this));
//$(this).children("tr:first").
$(this).val(letterArr[i]);
});
}
</script>
</head>
<body>
<input id="btnok" type=‘button‘ value="click">
<table border=‘1‘ width="400" id="tta">
<tr width="200">
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
<tr width="200">
<td><input type="text" class="add"></td>
<td><input type="text"></td>
<td><input type="text"></td>
<td><input type="text"></td>
<td><input type="text"></td>
</tr>
</table>
</body>
</html>