```
<script>
function addRow()
{
$('#newitems tr:last').before('<tr><td><input type="text" name="itemnum" value="value"></td></tr>');
}
</script>

```

I'm trying to figure out if it is possible to set a variable to increment the "name" and "value" of the function above each time the addRow() function is called. In other words I want the following output:

**First call to addRow() returns**

```
<tr><td><input type="text" name="itemnum1" value="value1"></td></tr>

```

**Second call to addRow() returns**

```
<tr><td><input type="text" name="itemnum2" value="value2"></td></tr>

```

**Third call to addRow() returns**

```
<tr><td><input type="text" name="itemnum3" value="value3"></td></tr>

```

etc, etc

Any help would be greatly appreciated.