var id = snapshot.val().id; var content = snapshot.val().content; var textObj = '<div class="task-item">\ <input type="checkbox" />\ <span class="ui-icon ui-icon-clock"></span>\ <span class="task-content">'+content+'</span>\ <span class="task-detail"> detail</span>\ </div>';我想把第一行的id变量(是一个数字)加到第三行div标签的class属性里面,可以直接嵌进去吗?
1 回答
阿波罗的战车
TA贡献1862条经验 获得超6个赞
var id = snapshot.val().id;
var content = snapshot.val().content;
var textObj = '<div class="task-item'+id+'">\
<input type="checkbox" />\
<span class="ui-icon ui-icon-clock"></span>\
<span class="task-content">'+content+'</span>\
<span class="task-detail"> detail</span>\
</div>';
添加回答
举报
0/150
提交
取消