var table = document.getElementById(table1);
var lastRow = table.rows.length;
var country = lastRow.getElementById('Country');
country.setAttribute('class', "Country"+lastRow);
Im pretty new and I was wondering if this is possible?
Instead of
var Country= document.getElementById('Country');
As I have other id=Country because I am adding new rows..
EDIT
I know ID are unique. But I am cloning the last row so of course the IDs will all be the same.
An ID in an HTML document is unique. Hence there is no need to do sub-queries in order to find elements. Instead always use
document.getElementById('Country')