0

TEST

HeadTr.appendChild(CityTd);                            //NodeHead
HeadTr.appendChild(ValueTd);
HeadTr.appendChild(OpTd);
contact.appendChild(HeadTr);


console.log(contact);                                  


for( node in aqiData){                                  //NodeChild
    var Tr = document.createElement('tr');
    var NCityTd = document.createElement('td');
    var NValueTd = document.createElement('td');
    var DelTd = document.createElement('td');
    var Button = document.createElement('button');

    Button.innerHTML = 'del';
    NCityTd.innerHTML = node;
    NValueTd.innerHTML = aqiData[node];

    DelTd.appendChild(Button);
    Tr.appendChild(NCityTd);
    Tr.appendChild(NValueTd);
    Tr.appendChild(DelTd);
    contact.appendChild(Tr);  
}

OUTPUT enter image description here

The NodeChild is behind the console.log.

In my point,the console.log only output the NodeHead

why the console.log output the NodeChild

YXC.Coder
  • 41
  • 6

0 Answers0