lzth.net
ǰλãҳ >> DoCumEnt.gEtElEmEntByID(iD).ChilDNoDEsΪʲôֻ... >>

DoCumEnt.gEtElEmEntByID(iD).ChilDNoDEsΪʲôֻ...

var obj = document.getElementById(id).childNodes ID ӦԪжԪصĻ obj[1],obj[2] ĬǷض ʹ±

fmʲôؼidCannot read property 'innerText' of undefined˵innerTextԲܶûж塣 ѴҰ ĵһġ var a; alert(a); 룬ͻסundefin...

ԪDzǶ׵ Υw3cı׼ jsǻȡǶ׵h2 Ϊʲô1 ΪԪصıڵҲԪأԵ1 ôΪʲôڶأ ΪdivǿǶģԻȡԪdivһ...

δеcellsڻȡеĵԪǰһ󣬺innerHTMLȡԪtdе

дԣdocument.getElementById("a")ûgetElementByIdԡ ֱdocument.getElementById("b").innerHTML һҪͨaȡӽڵ㣺document.getElementById('a').childNodes[0].innerHTML

childNodes ûãص⣬ܰ˺ܶûõĿսڵ㣬childNodes()ȡԪDzԵġ tableлȡtrtdȻͦ tr=tbs.rows[] td=tbs.rows[].cells[] tbody...

Ǹʾ˼ null û childNodes Ȼͻ֣û null Ϊ document.getElementById("tabs") null ˵ û id = tabs Ԫء Ȼ͸֣дӦ HTML ...

ãܸΪɣ getElementsByNamedocumentķʹtableArr[i].getElementsByName("b"); ڻ˽ݡϣҵĻشʣӭڱƽ̨ѯ

վҳ | վͼ
All rights reserved Powered by www.lzth.net
copyright ©right 2010-2021
磬ַϵͷzhit325@qq.com