javascript - Get last row of table attribute -
var table = document.getelementbyid(table1); var lastrow = table.rows.length; var country = lastrow.getelementbyid('country'); country.setattribute('class', "country"+lastrow);
im pretty new , wondering if possible?
instead of
var country= document.getelementbyid('country');
as have other id=country because adding new rows..
edit
i know id unique. cloning last row of course ids same.
an id in html document unique. hence there no need sub-queries in order find elements. instead use document.getelementbyid('country')
Comments
Post a Comment