var userTableStr = '';
userTableStr += '<table width="750" height="33" border="1">';
userTableStr += '<tr>';
userTableStr += '<td width="100"><input type="text" size ="11" value=""/></td>';
userTableStr += '<td width="100"><input type="text" value="" size ="11"/></td>';
userTableStr += '<td width="90"><input type="text" value="" size ="8"/></td>';
userTableStr += '<td width="390"><select name="tableColumnsName" id="tableColumnsName" onchange="setDataTypeLength()">';
userTableStr += '<option>--请选择--</option>';
for (var j = 0; j < selecedAllColumns.length; j++) {
var objcolumns = selecedAllColumns[j].columnName + "," + selecedAllColumns[j].dataType + "," + selecedAllColumns[j].dataLength;
userTableStr += '<option value="' + objcolumns + '">' + selecedAllColumns[j].columnName + '</option>';
}
userTableStr += '</select></td>';
userTableStr += '<td width="60"><input type="text" value=""/></td>';
userTableStr += '<td width="20"><input type="text" value="" size ="3"/></td>';
userTableStr += '<td width="93"><input id="primaryKey" type="radio" /></td>';
userTableStr += '<td width="93"><input id="defaultValue" type="text" value="" size ="20" /></td>';
userTableStr += '</tr>';
userTableStr += '</table>';
showContentObj.innerHTML = showContentObj.innerHTML + userTableStr;
全局就是一个userTableStr的空字符串,一直是+=的形式,把所有想要的表单写好,中间加了一个下拉框的选择,
也可以加上触发函数,都可以加上。再次学习一下:rows[0]["Name"]==rows[0].Name
--------------------------------------------------------------------------------------------------------
也可以用Jquery的Append来追加的
$("#div").append("<table><tr align='center'>" + "<td >" + "拼接的DIV内容" + "</td>" + "</tr></table>");
function GetProductOrderInfo(obj) {
var strhtml = "<ul class='artDialogDiv'>";
$.each(obj,
function(i, item) {
strhtml += "<li>" + item.OrderNo + " <a href='/product/OrderIndex'>查看</a> </li>";
});
strhtml += "</ul>";
return strhtml;
}
(2追加:)$("#pText").append("<span>2222</span>");结果是:<pid="1"><p>1111</p><span>2222</span></p>