如何在HTML中将元素的id属性添加为以上在javascript中声明的变量。将id属性的值设置为html中的变量
jQuery的
var table_row = $('table').find('tr#'+pid);
var name = table_row.find('td:nth-child(1)').html();
table_row.find('td:nth-child(6)').html('<button type="button" id="what to write here" class ="save_db")>save</button> ');
我想设置id作为名称。
感谢
无法找到你。请解释。 –
无法找到你。请解释。 – Tuhin
(根据我的理解)他想通过使用javascript varibale动态设置id。请在他的代码片段中查看“在这里写什么”文本。 –