HTML DOM Element childNodes အချက်အလက်

အချက်အလက် နှင့် အသုံးပြု

childNodes အချက်အလက် သည် အရာဝတ္တု အသုံးပြုသည် အချက်အလက် အစုအဝေး ပါ

childNodes အချက်အလက် သည် NodeList အချက်အလက် ပါ

childNodes အချက်အလက် သည် သာသာသာ ကျမ်းကို ဖြင့် မတွေ့ရ

childNodes[0] အချက်အလက် firstChild နှင့် အတူ

အကြောင်းကြား

childNodes အသုံးပြုသည် အချက်အလက်: အရာဝတ္တု အသုံးပြုသည် အချက်အလက် နှင့် စကားလုံး အသုံးပြုသည်

အရာဝတ္တု အကြား အကွာအဝေး သည် စကားလုံး အသုံးပြုသည်

အခြား အကျိုးဆက်

children အချက်အလက် - children အချက်အလက် သို့မဟုတ် စကားလုံး နှင့် အစီရင်ခံစာများ ကို လွဲပြောင်

အချက်အလက် ကျမ်းကို ကြည့်ပါ

firstChild အချက်အလက်

lastChild အချက်အလက်

nextSibling အချက်အလက်

previousSibling အချက်အလက်

hasChildNodes() စက်မှု

သို့မဟုတ် အသုံးပြုသည်

parentNode အချက်အလက်

nodeName အချက်အလက်

nodeType 属性

nodeValue attribute

HTML nodes and elements

in HTML DOM(Document Object Model) in, HTML document is a collection of nodes (or without) child nodes.

nodesrefers to element nodes, text nodes, and comment nodes.

elementswhitespace between elements is also a text node.

while elements are just element nodes.

child nodes and child elements

childNodes returnchild nodes(element node, text node, and comment node)

children returnကစ်စ်

အခြေအနေ နှင့် 'အမှူး' နှင့် 'အမြီး' တို့ဖြင့် (သော်လည်း အခြေအနေ နှင့် အစီအစဉ် ဘေ့စ်စ် အခြေအနေများ မပါ)

အခြေအနေအခြေအနေ နှင့် 'အမှူး' နှင့် 'အမြီး' တို့ဖြင့်

အခြေအနေအခြေအနေ အတူ ရှိသော ဘေ့စ်စ် (အတူ) childNodes list)。

အခြေအနေ အတူအခြေအနေ အတူ ရှိသော အခြေအနေ (အတူ) children list)。

example

example 1

<body> အခြေအနေ၏ child nodes ကို

const nodeList = document.body.childNodes;

ကျွန်ုပ်လိုက်ကျွန်းပါ

example 2

"myDIV" အခြေအနေ၏ child nodes အရာများ အင်အားကို

let numb = document.getElementById("myDIV").childNodes.length;

ကျွန်ုပ်လိုက်ကျွန်းပါ

example 3

second child node's background color change

element.childNodes[1].style.backgroundColor = "yellow";

ကျွန်ုပ်လိုက်ကျွန်းပါ

example 4

get <select> အခြေအနေ၏ တတိယ ကစ်စ် အခြေအနေကို

let text = document.getElementById("mySelect").childNodes[2].text;

ကျွန်ုပ်လိုက်ကျွန်းပါ

အပြောအဆို

element.childNodes

ပြန်လည်ပေးသော အရာ

အမျိုးအစား ဖော်ပြ
အရာ

ဘေ့စ်စ် အခြေအနေ NodeList အဖွဲ့

ဘေ့စ်စ် အခြေအနေ သည် အခြေအနေ တွင် ပေါ်ထွက်သော အမှားမဟုတ်။

ဘရပ်ဆိုက် ထောက်ပံ့

element.childNodes သည် DOM Level 1 (1998) သဘောတရသည်။

အားလုံး ဘရပ်ဆိုက်များ တို့ ကျွမ်းကျွမ်းစွာ ထောက်ပံ့သည့််

ချော်ချော အီးအီ အိန်ဂျယ် ဖော့ဖ် ဆော်ဖ်ဖီ အိုပရာ
ချော်ချော အီးအီ အိန်ဂျယ် ဖော့ဖ် ဆော်ဖ်ဖီ အိုပရာ
ထောက်ပံ့ 9-11 ထောက်ပံ့ ထောက်ပံ့ ထောက်ပံ့ ထောက်ပံ့