how to delete added rows ??

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

how to delete added rows ??

Post by PHPycho »

Hello forums !!
I had used the following javascript code for adding rows

Code: Select all

function addRow(row)
{
	table = row.parentNode.parentNode;
	pos = row.rowIndex;	
	
	// Row for file
	k = 0;
	row = table.insertRow(pos);
	cell = row.insertCell(k++);
	//cell.setAttribute('align','right');	
	cell.innerHTML = 'File Upload';
	cell = row.insertCell(k++);	
	cell.innerHTML = '<input type="text" name="title[]" class="text" />';	
}
for event handling

Code: Select all

<input class="text" type="button" name="add" value="add more &raquo;" onclick="addRow(this.parentNode.parentNode)" />
I want to make some change with the function.
I want to add a function that deletes the row created by js
how to perform such ?
Please help me. Any help and suggestions will be highly appreciated.
Thank you
Post Reply