0

Hello, whenever I try to call this function, web developer plugin for firefox gives me a message that says: "Error: addRow is not defined
Source File: http://localhost/xampp/Aptana/index.php
Line: 1"

Here is my code:

<script type="text/javascript">
var k = 7;
			function addRow()
			{
				var rowItem = document.createElement('input');
				newRow.setAttribute('type', 'text');
				newRow.setAttribute('name', 'item' + k);
				document.getElementById('myDiv').appendChild(rowItem);
				var rowPart = document.createElement('input');
				newRow.setAttribute('type', 'text');
				newRow.setAttribute('name', 'part' + k);
				document.getElementById('myDiv').appendChild(rowPart);
				k++;
			}
</script>
		<form>
		<input type="button" value="Add a Row" onclick="addRow()" />
		</form>
1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by adaykin
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.