concatinating 1 string and an int value while giving id value to a <button> field which is generated dynamically in HTML
var bu开发者_高级运维t = document.createElement('span');
but.innerHTML.id="but1"+inc;
but.innerHTML = '<button value="delete row" id="'but'+inc"
onclick="deleteRow(this.id)">delete row</button>';
// '"but"+inc' , "but+inc" are not working
//here inc is an integer value which increments by one
this is wrong
but.innerHTML.id="but1"+inc;
this is how it should be
but.id="but1"+inc;
but.innerHTML = '<button value="delete row" id="but'+inc+'" onclick="deleteRow(this.id)">delete row</button>';
精彩评论