Hello,
I have those dynamic td
one table has
<td id="1'pos_xx"></td><td id="2'pos_xx"></td><td id="3_'pos_xx"></td>
Where the amount of td could be anything.
1, 2, and 3 are $i values from php
I am inserting values via ajax inside the td
for a table with one td slot I do
var position = document.getElementById('pos_' + posid).innerHTML;
if(position > '')
{
alert ('position has been filled! ');
return false;
}
in my function I send
function addItem(id, posid, pcount)
where pcount is the maximum slots (total $i values) in that table
How can I know if any of the td in (multiple td ) is empty?
My first approach was
var tds = tbody.getElementsByTagName('pos_' + posid);
var lastRow = tds[tds.length - 1];
var lastId = lastRow.id;
But that does not work.
Can someone please help?
Thanks.