用jquery控制html控件

var row = $("#template" + i).clone(); 
row.find("#ExecTime").text(n.ExecTime);
row.find("#ExecName").text(n.ExecName);
row.find("#ExecNum").text(n.ExecNum);
row.find("#ExecMoney").text(n.ExecMoney);
row.find("#ExecRes").text(n.ExecRes);
row.appendTo("#datas");//添加到模板的容器中

 

 

var td = $("<tr>"); //创建tr标签
td.attr('id', 'template' + i); //设置标签属性aa=‘template’
$("#template_body").append(td);  //将此标签加到id='template_body'的标签内部

 


var td1 = $("<td>");   //创建td标签
td1.attr('id', id);   //设置标签属性id=‘td_aa’
td1.attr('rowspan', row);  //设置标签属性
td1.html(data);   //设置td标签文本值为'哈哈哈哈'
$("#template" + i).append(td1);   //将新创建的td标签插到id为tr_id1的标签中

posted @ 2020-10-30 11:46  jonykuku  阅读(92)  评论(0编辑  收藏  举报