您好
x.chlidren 是一個像是陣列的東西 ( HTMLCollection ), 印出來後會看到
// x.chlidren => 陣列 // x.chlidren[0] => 陣列裡的東西 const x = { children: [{ nodeName: "SPAN", textContent: 'test01' }, { nodeName: "INPUT", textContent: "" } ] } // x.children 是一個像是陣列的東西,所以在陣列裡面找 textContent 屬性會 error console.log(x.children.textContent) console.log(x.children[0].textContent)
你的轉職路上,還缺少一份自學作業包!寫完這幾包,直接拿作品去面試上班!
本論壇另有附設一個 LINE 新手發問&交流群組!歡迎加入討論!
您好
x.chlidren 是一個像是陣列的東西 ( HTMLCollection ), 印出來後會看到