<table border="1" id="matt">
<tr>
<td><input type="text" id="txtTitle" name="txtTitle"></td>
<td><input type="text" id="txtLink" name="txtLink"></td>
</tr>
<tr>
<td><input type="text"></td>
<td><input type="text"></td>
</tr>
<tr>
<td><input type="text"></td>
<td><input type="text"></td>
</tr>
<script language="javascript">
var i = 1;
$(window).load(function() {
$("tbody tr:last").find("input").each(function() {
$(this).attr({
'id': function(_, id) { return id + i },
'name': function(_, name) { return name + i },
'value': ''
});
}).end().appendTo("#matt");
i++;
});
</script>
given this code.. I want to generate and copy the attributes/tag from the first row of the table as the form loads, it should be unique..any help? I'm having a hard time.