Wednesday, September 30, 2009

[jQuery] Re: Getting Last ID

Thanks.

The first row is always there. It cannot be removed if it's only one row.

However, I just realized that the code that I am using is not jQuery

function addNewRow(newId)
{
var tbody = document.getElementById('list').tBodies[0];
var lastRow = tbody.rows.length - 1;
var newId = lastRow;

var row = document.createElement('tr');
row.setAttribute('id', newId);

etc ... etc ...

tbody.appendChild(row);

return ++rowId;
}

Everything works perfect in that script I am making except for that part
:blush:

--
View this message in context: http://www.nabble.com/Getting-Last-ID-tp25679707s27240p25681092.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

No comments: