js创建html标签

function createBtnHtml(obj,ids){
var row = obj.insertRow(obj.rows.length);  //行对象
var col;  //列对象
col = row.insertCell(0);
row.setAttribute("id","btn_row");
col.setAttribute("colspan","8");
var but_html_str="";

if('${checkperm_reanewal}'=='true'){
alert('${checkperm_reanewal}');
but_html_str=(but_html_str!=''?but_html_str:'')+"<button type=\"button\" οnclick=\"setBtnClick(ids,1);\"/><fmt:message key="批量续办"></fmt:message> </button>";
}
if('${checkperm_cancel}'=='true'){
alert("00"+'${checkperm_cancel}');
but_html_str=(but_html_str!=''?but_html_str:'')+"<button type=\"button\" οnclick=\"setBtnClick(ids,2);\"/><fmt:message key="批量撤销"></fmt:message> </button>";
alert(but_html_str);
}
col.innerHTML = but_html_str;
}

版权声明:本文为rugaxm原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。