拼接在写js的时候常常用到
1.html部分
<tr class="table-header"> <td></td> <td class="mingcheng"></td> <td class="faren"></td> <td class="dianhua"></td> <td><img src=""/></td> <td></td> <td class="operate"> <button class="EditSupp" type="button">编辑</button> <button class="DelSupp" type="button">删除</button> </td> </tr>
2.js拼接
var trStr="<tr class="table-header">"+
"<td>"+"</td>"+
"<td class="mingcheng">"+"</td>"+
"<td class="faren">"+"</td>"+
"<td class="dianhua">"+"</td>"+
"<td>"+"<img src=""/>"+"</td>"+
"<td>"+"</td>"+
"<td class="operate">"+
"<button class="EditSupp" type="button">编辑</button>"+
"<button class="DelSupp" type="button">删除</button>"+
"</td>"+
"</tr>";