If the object is a TextNode, the nodeValue property returns a string representing the text contained by the node.Expressions cannot be used to change the nodeValue of a TextNode object.If the object is an attribute object retrieved from the attributes collection, the nodeValue property returns the value of the attribute if it has been specified, or null otherwise.If the object is an element, the nodeValue returns null. Use the nodeName property to determine the element name.alert(document.getElementById('taskTable').childNodes[0].childNodes[0].childNodes[0].innerText)
alert(document.getElementById('taskTable').rows[0].cells[0].innerText)

解决方案 »

  1.   

    If the object is a TextNode, the nodeValue property returns a string representing the text contained by the node.Expressions cannot be used to change the nodeValue of a TextNode object.If the object is an attribute object retrieved from the attributes collection, the nodeValue property returns the value of the attribute if it has been specified, or null otherwise.If the object is an element, the nodeValue returns null. Use the nodeName property to determine the element name.alert(document.getElementById('taskTable').childNodes[0].childNodes[0].childNodes[0].innerText)
    alert(document.getElementById('taskTable').rows[0].cells[0].innerText)
      

  2.   

    var t = document.getElementById('taskTable').getElementsByTagName('tr')[0];
    alert(t.childNodes[0].innerHTML);这样就可以得到任务名了