yes, for examplefunction createNewRow() {
var aNewRow = model.rows[0].cloneNode(true);
        /*var input = document.createElement("INPUT");
input.type="text";
input.id = "hello";
aNewRow.children[0].appendChild(input);
*/ var input =aNewRow.children[0].children[0];
alert(input.name);
input.value = "abc";
//alert(aNewRow.innerHTML);
return aNewRow;
}

解决方案 »

  1.   

    为什么是两个children呢,能解释一下吗,我的aNewRow结构是
    <tr>
    <td><input type="checkbox" name="aa"></td>
    <td><input type="text" name="bb"></td>
    <td><input type="text" name="cc"></td>
    <td><input type="text" name="dd"></td></tr>
      

  2.   

    如果我的aNewRow结构是
    <tr>
    <td><input type="checkbox" name="aa"></td>
    <td><input type="text" name="bb"><input type="text" name="bbb"><input type="text" name="bbbb"></td>
    <td><input type="text" name="cc"></td>
    <td><input type="text" name="dd"></td></tr>
    呢,该怎么处理?
      

  3.   

    如果我用children[0].children[3]的时候,总是出错
    说访问 的那个不是对象
      

  4.   

    first children is the index of <td>, the second children is for the input controls, in your case, you might meanaNewRow.children[1].children[2]; //second <td>, the third <input>