My code is as follows:
<script>
var i = 2;
$("document").ready(function(){
$("#newrow").click(function(){
$("#maintable").append('<tr>
<td><input type="text" name="dept_" + i size="5" maxlength="5" /></td>
<td><input type="text" name="hours_" + i size="5" maxlength="1" /></td>
</tr>');
});
i = i + 1;
});
</script>
Whenever I run it, JavaScript gives me an "Uncaught SyntaxError: Unexpected Token ILLEGAL" on the $("#maintable").append line.
For the life of me, I can't figure out what the syntax error is.
It's not a problem with the actual element being appended, because I tried just '<td></td>' as well and that got the same error.