<table id="printTable" class="inputNeed">
<tr>
<td>
<td>
<tr>
</table>js代码:
var pri = document.getElementById("printTable").cloneNode(true);//克隆节点。现在我想将节点里面的css样式inputNeed修改成另一个样式,如inputNeedNew这个样式,请问如何修改?谢谢?

解决方案 »

  1.   

    pri.className="inputNeedNew";
    LZ还需要将pri的id删除或更改,否则加入文档后之前的printTable将无效
      

  2.   


    如何对pri的id进行删除或更改。pri.className="inputNeedNew";这样是不行的。
      

  3.   

    var pri = document.getElementById("printTable").cloneNode(true);//克隆节点。 
    pri.setAttribute('id','printTable_new');
    pri.className = "inputNeedNew";
      

  4.   

    jqurey吧,应该比较好实现这个功能
      

  5.   

    <table id="printTable" class="inputNeed"> 
    <tr id="printTr" class="trNeed"> 
    <td> 
    <td> 
    <tr> 
    </table> js代码: 
    var pri = document.getElementById("printTable").cloneNode(true);//克隆节点。 
    现在我想改变克隆节点(pri)里面的tr的css样式,请问如何实现?