<td id="aa" style="width: 90%; text-align: center;"></td>
var htm = "<input type='CheckBox' id='" + tableArrayEN + "' str='" + strall + "' condition='" + conall + "' style='display:none'/>";
htm += "已选择的列有: " + lineall.substring(0, lineall.length - 1);
//htm += "</div>";
$("#aa").innerhtml(htm);我试 了好多函数,append ,text,html等等,都不能插入这段js,求指教
var htm = "<input type='CheckBox' id='" + tableArrayEN + "' str='" + strall + "' condition='" + conall + "' style='display:none'/>";
htm += "已选择的列有: " + lineall.substring(0, lineall.length - 1);
//htm += "</div>";
$("#aa").innerhtml(htm);我试 了好多函数,append ,text,html等等,都不能插入这段js,求指教
改成这样。
$("#aa").html(htm);
<tr>
<td id="aa" style="width: 90%; text-align: center;"></td>
</tr>
</table> var htm = "<input type='CheckBox' id='" + 7 + "' str='" + 7 + "' condition='" + 7 + "' style='display:none'/>";
htm += "已选择的列有: " + 8;
$("#aa").html(htm); 这样写是好用的。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<script src="jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript"> var htm = "<input type='text' />";
function AppendHtml()
{
$("#aa").append(htm);
}</script>
</head> <body><table>
<tr>
<td id="aa" style="width: 90%; text-align: center; " onclick="AppendHtml()">ad</td>
</tr>
</table> </body>
</html>可以的啊! 应该是你这里面有 style='display:none'所以没有显示吧
<tbody>
<tr>
<tr>
<td id="*tdPRO_CladMeasurement" style="width:10%;height:40px;text-align:right;cursor:pointer;">外包测试</td>
<td id="PRO_CladMeasurement" style="width:90%;text-align:center;"></td>...
难道是我没匹配到这个td? $("#CladMeasurement").append(htm);不行啊
改为 $("#PRO_CladMeasurement").append(htm);