<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,求指教

解决方案 »

  1.   

    简而言之,就是在原来已经有的<td></td>中插入新的页面用什么函数
      

  2.   

    $("#aa").innerhtml(htm)?
    改成这样。
    $("#aa").html(htm);
      

  3.   

    <table width="200" border="1">
        <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); 这样写是好用的。
      

  4.   


    <!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'所以没有显示吧
      

  5.   

    用append可以的,我现在就是用这个。
      

  6.   

    <table id="selectdatatables" class="tableCss" style="width:100%;">
    <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);不行啊
      

  7.   

    我顶,你的代码中 根本不存在 id为“CladMeasurement”的元素;
    改为 $("#PRO_CladMeasurement").append(htm);