JavaScript 3์ฃผ์ฐจ(3) - DOM

๋ฐ•์ˆ˜์ง€ยท2024๋…„ 10์›” 14์ผ

TIL

๋ชฉ๋ก ๋ณด๊ธฐ
8/9
post-thumbnail

๐Ÿ’ญDOM(Document Object Model)์ด๋ž€?

๋ฌธ์„œ๊ฐ์ฒด๋ชจ๋ธ์ด๋ผ๊ณ  ํ•˜๋ฉฐ HTML ํ˜น์€ XML๋ฌธ์„œ๋ฅผ ๊ตฌ์กฐํ™”ํ•˜์—ฌ ๊ณ„์ธต์ ์œผ๋กœ ํ‘œํ˜„๋œ ๊ฐ ์š”์†Œ๋ฅผ ๊ฐ์ฒด๋กœ ํ‘œํ˜„

DOM์˜ ํŠน์ง•

  • ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ DOM ๊ตฌ์กฐ์— ์ ‘๊ทผํ•˜๊ณ  ์ด๋ฅผ ๋™์ ์œผ๋กœ ์กฐ์ž‘ํ•˜์—ฌ ๋ฌธ์„œ ๊ตฌ์กฐ, ์Šคํƒ€์ผ, ๋‚ด์šฉ ๋“ฑ์„ ์ถ”๊ฐ€, ์‚ญ์ œ ํ•˜๊ฑฐ๋‚˜ ๋ณ€๊ฒฝ ํ•  ์ˆ˜ ์žˆ์Œ

  • DOM์€ ํŠธ๋ฆฌ ๊ตฌ์กฐ(๊ณ„์ธต ๊ตฌ์กฐ)๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ์œผ๋ฉฐ, ํŠธ๋ฆฌ๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ๊ฐ ๊ฐ์ฒด๋“ค์„ '๋…ธ๋“œ(Node)'๋ผ๊ณ  ๋ถ€๋ฆ„

  • ๋…ธ๋“œ๋“ค ์‚ฌ์ด์—๋Š” ๋ถ€๋ชจ(parent)์™€ ์ž์‹(child)๋ผ๋Š” ๊ณ„์ธต๊ด€๊ณ„๊ฐ€ ์ •์˜๋จ
    ex) parentNode, childNodes, firstChild, lastChild

๐Ÿ“ŒDOM tree ์˜ˆ์‹œ


์ถœ์ฒ˜: https://poiemaweb.com/js-dom

<!DOCTYPE html>
<html>
    <body>
        <div>
            <h1>Color</h1>
            <ul>
                <li id="red" class="box">red</li>
                <li id="yellow" class="box">yellow</li>
                <li id="green" class="box">green</li>
                <li id="blue" class="box">blue</li>
            </ul>
        </div>
    </body>
</html>
  • ๋ฌธ์„œ ๋…ธ๋“œ(Document Node)
    document ๊ฐ์ฒด๋ฅผ ๋งํ•˜๋ฉฐ DOM ํŠธ๋ฆฌ์— ์ ‘๊ทผํ•˜๊ธฐ ์œ„ํ•œ ์‹œ์ž‘์ ์ด์ž ์ตœ์ƒ์œ„ ๋…ธ๋“œ

  • ์š”์†Œ ๋…ธ๋“œ(Element Node)
    HTML ๊ตฌ์„ฑ ์š”์†Œ ์ฆ‰ ํƒœ๊ทธ๋ฅผ ์˜๋ฏธํ•˜๋ฉฐ ๊ฐ๊ฐ์˜ Element Node๋Š” ๋‹ค์‹œ Attribute Node์™€ Text Node๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Œ

  • ์–ดํŠธ๋ฆฌ๋ทฐํŠธ ๋…ธ๋“œ(Attribute Node)
    ํƒœ๊ทธ๋“ค์˜ ์†์„ฑ์„ ๊ฐ์ฒดํ™”ํ•œ ๋…ธ๋“œ๋กœ ๋งŒ์ผ ํŠน์ • ํƒœ๊ทธ์˜ ์†์„ฑ์— ์ ‘๊ทผํ•˜๋ ค๋ฉด Attribute Node๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•จ

  • ํ…์ŠคํŠธ ๋…ธ๋“œ(Text Node)
    ํƒœ๊ทธ์˜ ํ…์ŠคํŠธ๋ฅผ ๊ฐ์ฒดํ™”ํ•œ DOM ํŠธ๋ฆฌ๊ตฌ์กฐ์˜ ์ตœ์ข…๋‹จ ๋…ธ๋“œ๋กœ ์ž์‹ ๋…ธ๋“œ๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์—†์Œ

๐Ÿ’ญDOM ์š”์†Œ ์ ‘๊ทผ

1. ์š”์†Œ ๋…ธ๋“œ ์„ ํƒ

1) querySelector(cssSelector)

  • CSS ์„ ํƒ์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์š”์†Œ ๋…ธ๋“œ๋ฅผ ํ•œ ๊ฐœ ์„ ํƒ
  • ๋ณต์ˆ˜๊ฐœ๊ฐ€ ์„ ํƒ๋œ ๊ฒฝ์šฐ, ์ฒซ๋ฒˆ์งธ ์š”์†Œ๋…ธ๋“œ๋งŒ ๋ฐ˜ํ™˜
  • ์ฝค๋งˆ(,)๋กœ ๊ตฌ๋ถ„๋œ ์—ฌ๋Ÿฌ ์…€๋ ‰ํ„ฐ๋ฅผ ๋‚˜์—ด ํ•  ์ˆ˜ ์žˆ์Œ

๐Ÿ“Œ์˜ˆ์‹œ

const red = document.querySelector('#red');

console.log(red);  // li#red.box

2) querySelectorAll(selector)

  • CSS ์„ ํƒ์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ•ด๋‹น ์š”์†Œ ๋…ธ๋“œ๋ฅผ ๋ชจ๋‘ ์„ ํƒ
  • NodeList๋ฅผ ๋ฐ˜ํ™˜

๐Ÿ“Œ์˜ˆ์‹œ

const box = document.querySelectorAll(".box");

console.log(box);  
// NodeList(4) 
[li#red.box, li#yellow.box, li#green.box, li#blue.box]

3) getElementById(id)

  • id ์†์„ฑ๊ฐ’์„ ์‚ฌ์šฉํ•˜์—ฌ ์š”์†Œ ๋…ธ๋“œ๋ฅผ ํ•œ ๊ฐœ ์„ ํƒ
  • ๋ณต์ˆ˜๊ฐœ๊ฐ€ ์„ ํƒ๋œ ๊ฒฝ์šฐ, ์ฒซ๋ฒˆ์งธ ์š”์†Œ๋งŒ ๋ฐ˜ํ™˜

๐Ÿ“Œ์˜ˆ์‹œ

const blue = document.getElementById('blue');

console.log(blue);  // li#blue.box

4) getElementsByClassName(class)

  • class ์†์„ฑ๊ฐ’์„ ์‚ฌ์šฉํ•˜์—ฌ ์š”์†Œ ๋…ธ๋“œ๋ฅผ ๋ชจ๋‘ ์„ ํƒ
  • ๊ณต๋ฐฑ์œผ๋กœ ๊ตฌ๋ถ„ํ•˜์—ฌ ์—ฌ๋Ÿฌ ๊ฐœ์˜ class๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Œ
  • HTML Collection์„ ๋ฐ˜ํ™˜

๐Ÿ“Œ์˜ˆ์‹œ

const all_box = document.getElementsByClassName("box");

console.log(all_box);  
// HTMLCollection(4) 
[li#red.box, li#yellow.box, li#green.box, li#blue.box, 
red: li#red.box, yellow: li#yellow.box, green: li#green.box, blue: li#blue.box]

5) getElementsByTagName(tagName)

  • ํƒœ๊ทธ๋ช…์„ ์‚ฌ์šฉํ•˜์—ฌ ์š”์†Œ ๋…ธ๋“œ๋ฅผ ๋ชจ๋‘ ์„ ํƒ
  • HTML Collection์„ ๋ฐ˜ํ™˜

๐Ÿ“Œ์˜ˆ์‹œ

const Li = document.getElementsByTagName('li');

console.log(Li);
// HTMLCollection(4) 
[li#red.box, li#yellow.box, li#green.box, li#blue.box, red: li#red.box, yellow: li#yellow.box, green: li#green.box, blue: li#blue.box]

2. ์š”์†Œ ๋…ธ๋“œ ํƒ์ƒ‰

const element = document.querySelector('ul');  

1) parentNode

  • ๋ถ€๋ชจ ๋…ธ๋“œ๋ฅผ ํƒ์ƒ‰
  • parentElement๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์š”์†Œ ํƒ€์ž… ๋ถ€๋ชจ ๋…ธ๋“œ๋งŒ ํƒ์ƒ‰

๐Ÿ“Œ์˜ˆ์‹œ

const parentNode = element.parentNode;

console.log(parentNode);  // div

2) firstChild, lastChild

  • ํ…์ŠคํŠธ ๋…ธ๋“œ๋ฅผ ํฌํ•จํ•œ ๋ชจ๋“  ์ž์‹ ๋…ธ๋“œ ์ค‘์—์„œ ์ฒซ๋ฒˆ์งธ ์ž์‹๊ณผ ๋งˆ์ง€๋ง‰ ์ž์‹ ๋…ธ๋“œ๋ฅผ ํƒ์ƒ‰
  • firstElementChild, lastElementChild๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ž์‹ ๋…ธ๋“œ ์ค‘์—์„œ ์š”์†Œ ํƒ€์ž… ๋…ธ๋“œ๋งŒ์„ ํƒ์ƒ‰

๐Ÿ“Œ์˜ˆ์‹œ

const firstChild = element.firstChild;
const lastChild = element.lastChild;

console.log(firstChild);  // #text
console.log(lastChild);  // #text


const firstelemChild = element.firstElementChild;
const lastelemChild = element.lastElementChild;

console.log(firstelemChild);  // li#red.box
console.log(lastelemChild);  // li#blue.box

3) childNodes

  • ํ…์ŠคํŠธ ๋…ธ๋“œ๋ฅผ ํฌํ•จํ•œ ๋ชจ๋“  ์ž์‹ ๋…ธ๋“œ๋ฅผ ํƒ์ƒ‰
  • ์ž์‹ ๋…ธ๋“œ์˜ ์ปฌ๋ ‰์…˜ NodeList๋ฅผ ๋ฐ˜ํ™˜
  • children์„ ์‚ฌ์šฉํ•˜๋ฉด ์ž์‹ ๋…ธ๋“œ ์ค‘์—์„œ ์š”์†Œ ํƒ€์ž… ๋…ธ๋“œ๋งŒ ํƒ์ƒ‰ํ•˜๊ณ  ์ž์‹ ๋…ธ๋“œ์˜ ์ปฌ๋ ‰์…˜ HTMLCollection์„ ๋ฐ˜ํ™˜

๐Ÿ“Œ์˜ˆ์‹œ

const childNodes = element.childNodes;

console.log(childNodes);  
// NodeList(9) 
[text, li#red.box, text, li#yellow.box, text, li#green.box, text, li#blue.box, text]


const children = element.children;

console.log(children);  
// HTMLCollection(4) 
[li#red.box, li#yellow.box, li#green.box, li#blue.box, 
red: li#red.box, yellow: li#yellow.box, green: li#green.box, blue: li#blue.box]

4) previousSibling, nextSibling

  • ํ…์ŠคํŠธ ๋…ธ๋“œ๋ฅผ ํฌํ•จํ•œ ๋ชจ๋“  ํ˜•์ œ ๋…ธ๋“œ ์ค‘์—์„œ ์ด์ „ ํ˜•์ œ์™€ ๋‹ค์Œ ํ˜•์ œ ๋…ธ๋“œ๋ฅผ ํƒ์ƒ‰
  • previousElementSibling, nextElementSibling๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ํ˜•์ œ ๋…ธ๋“œ ์ค‘์—์„œ ์š”์†Œ ํƒ€์ž… ๋…ธ๋“œ๋งŒ์„ ํƒ์ƒ‰

๐Ÿ“Œ์˜ˆ์‹œ

const nextSibling = firstChild.nextSibling;  
const preSibling = lastChild.previousSibling;  

console.log(nextSibling); // li#red.box
console.log(preSibling);  // li#blue.box


const nextElemSibling = firstelemChild.nextElementSibling;  
const preElemSibling = lastelemChild.previousElementSibling;  

console.log(nextElemSibling);  // li#yellow.box
console.log(preElemSibling);  // li#green.box

๐Ÿ’ญDOM ์š”์†Œ ์กฐ์ž‘

1. DOM ์š”์†Œ ์ƒ์„ฑ

1) createElement(tagName)

ํƒœ๊ทธ์ด๋ฆ„์„ ์ธ์ž๋กœ ์ „๋‹ฌํ•˜์—ฌ ์š”์†Œ๋ฅผ ์ƒ์„ฑ

๐Ÿ“Œ์˜ˆ์‹œ

const newDiv = document.createElement('div');
const newUl = document.createElement('ul');
const newLi = document.createElement('li');

2) createTextNode(text)

ํ…์ŠคํŠธ๋ฅผ ์ธ์ž๋กœ ์ „๋‹ฌํ•˜์—ฌ ํ…์ŠคํŠธ ๋…ธ๋“œ๋ฅผ ์ƒ์„ฑ

๐Ÿ“Œ์˜ˆ์‹œ

const newText = document.createTextNode('content');

2. DOM ์š”์†Œ ์ถ”๊ฐ€

3) appendChild(Node)

์ธ์ž๋กœ ์ „๋‹ฌํ•œ ๋…ธ๋“œ๋ฅผ ๋งˆ์ง€๋ง‰ ์ž์‹ ์š”์†Œ๋กœ DOM ํŠธ๋ฆฌ์— ์ถ”๊ฐ€

๐Ÿ“Œ์˜ˆ์‹œ

document.body.appendChild(newDiv); 
newDiv.appendChild(newUl);
newUl.appendChild(newLi);
newLi.appendChild(newText);

์ƒ์„ฑ๋œ DOM tree ๊ตฌ์กฐ

<body>
  <div>
      <ul>
          <li>"content"</li>
      </ul>
  </div>
</body>

3. DOM ์š”์†Œ ์ œ๊ฑฐ

4) removeChild(Node)

์ธ์ž๋กœ ์ „๋‹ฌํ•œ ๋…ธ๋“œ๋ฅผ DOM ํŠธ๋ฆฌ์—์„œ ์ œ๊ฑฐ

๐Ÿ“Œ์˜ˆ์‹œ

newDiv.removeChild(newUl);
// newDiv์˜ ์ž์‹์ธ newUl์š”์†Œ๋ฅผ DOM ํŠธ๋ฆฌ์—์„œ ์ œ๊ฑฐ

๐Ÿ’ญDOM ์š”์†Œ์˜ ์†์„ฑ ์กฐ์ž‘

<body>
  <input type="password" placeholder="๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.">
  <button type="button" onclick="show()">๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณด๊ธฐ</button>
  <button type="button" onclick="disable()">ํ™œ์„ฑํ™”/๋น„ํ™œ์„ฑํ™”</button>
</body>

<script>
  const Input = document.querySelector('input');  
  const Btn = document.querySelector('button');
</script>

1) hasAttribute(attribute)

  • ์š”์†Œ๊ฐ€ ์ง€์ •ํ•œ ์†์„ฑ์„ ๊ฐ€์ง€๊ณ  ์žˆ๋Š”์ง€ ๊ฒ€์‚ฌ
  • ์†์„ฑ์˜ ์กด์žฌ ์œ ๋ฌด์— ๋”ฐ๋ผ Boolean ๊ฐ’์„ ๋ฐ˜ํ™˜(true / false)

๐Ÿ“Œ์˜ˆ์‹œ

console.log(Input.hasAttribute('placeholder'));  //true
console.log(Input.hasAttribute('name'));  //false
console.log(Btn.hasAttribute('type'));  //true

2) getAttribute(attribute)

  • ์š”์†Œ์—์„œ ์ง€์ •ํ•œ ์†์„ฑ์˜ ๊ฐ’์„ ์ทจ๋“
  • ์†์„ฑ์ด ์กด์žฌํ•˜๋Š” ๊ฒฝ์šฐ ์†์„ฑ๊ฐ’์„ ๋ฌธ์ž์—ด๋กœ ๋ฐ˜ํ™˜ํ•˜๊ณ , ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ์—๋Š” null ๋ฐ˜ํ™˜

๐Ÿ“Œ์˜ˆ์‹œ

console.log(Input.getAttribute('type'));  //password
console.log(Input.getAttribute('value'));  //null
console.log(Btn.getAttribute('type'));  //button

3) setAttribute(attribute, value)

  • ์š”์†Œ์˜ ์†์„ฑ๊ณผ ์†์„ฑ๊ฐ’์„ ์„ค์ •
  • ์†์„ฑ์ด ์กด์žฌํ•˜๋Š” ๊ฒฝ์šฐ ์†์„ฑ๊ฐ’์ด ์—…๋ฐ์ดํŠธ๋˜๊ณ , ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ์—๋Š” ์ง€์ •๋œ ์ด๋ฆ„๊ณผ ๊ฐ’์œผ๋กœ ์ƒˆ ์†์„ฑ์ด ์ถ”๊ฐ€

๐Ÿ“Œ์˜ˆ์‹œ

function show() {
    Input.setAttribute('type', 'text');
    // input ํƒœ๊ทธ์˜ type ์†์„ฑ์˜ ๊ฐ’์„ password์—์„œ text๋กœ ์„ค์ •
}

4) removeAttribute(attribute)

  • ์š”์†Œ์—์„œ ์ง€์ •ํ•œ ์†์„ฑ์„ ์ œ๊ฑฐ

๐Ÿ“Œ์˜ˆ์‹œ

Input.removeAttribute('placeholder');
// input ํƒœ๊ทธ์˜ type ์†์„ฑ์„ ์ œ๊ฑฐ

5) toggleAttribute(attribute)

  • ์š”์†Œ์— ์†์„ฑ์ด ์กด์žฌํ•˜๋Š” ๊ฒฝ์šฐ ์ œ๊ฑฐํ•˜๊ณ , ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ์—๋Š” ์ถ”๊ฐ€

๐Ÿ“Œ์˜ˆ์‹œ

function disable() {
    Input.toggleAttribute('disabled');
    // input ํƒœ๊ทธ์˜ disabled ์†์„ฑ์„ ์ถ”๊ฐ€ / ์ œ๊ฑฐ
}

6) classList

  • class ์†์„ฑ์˜ ๊ฐ’์„ ์ทจ๋“ ๋˜๋Š” ๋ณ€๊ฒฝ
  • add, remove, toggle, contains, replace ๋ฉ”์†Œ๋“œ๋ฅผ ์ œ๊ณต

๐Ÿ“Œ์˜ˆ์‹œ

<style>
  .class_0 {font-weight: 400;}
  .class_1 {color: red;}
  .class_2 {font-size: 30px;}
  .class_3 {font-weight: 900;}
</style>

<body>
  <p id="text" class="class_0">Lorem ipsum</p>
</body>

<script>
  const Text = document.getElementById('text');
  
  Text.classList.add('class_1');  
  //class ์†์„ฑ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ๊ธ€์ž ์ƒ‰ ๋ณ€๊ฒฝ
  Text.classList.remove('class_1');  
  //class ์†์„ฑ์„ ์ œ๊ฑฐํ•˜์—ฌ ๊ธ€์ž ์ƒ‰ ์ดˆ๊ธฐํ™”
  Text.classList.toggle('class_2');  
  // class ์†์„ฑ์ด ์กด์žฌํ•˜๋ฉด ์ œ๊ฑฐํ•˜๊ณ  ์กด์žฌํ•˜์ง€ ์•Š์œผ๋ฉด ์ถ”๊ฐ€ํ•˜์—ฌ ๊ธ€์ž ํฌ๊ธฐ ๋ณ€๊ฒฝ
  console.log(Text.classList.contains('class_3'));  
  // class ์†์„ฑ์„ ๊ฐ€์ง€๊ณ  ์žˆ๋Š”์ง€ ๊ฒ€์‚ฌ -> false
  Text.classList.replace('class_0', 'class_3');
  // class ์†์„ฑ์„ ๊ต์ฒดํ•˜์—ฌ ๊ธ€์ž ๋‘๊ป˜ ๋ณ€๊ฒฝ
</script>

๐Ÿ’ญDOM ์š”์†Œ์˜ ํ…์ŠคํŠธ ์กฐ์ž‘

<body>
  <div>
  	<h1 id="title">This is the Title</h1>
    <ul id="list">
        <li>textContent</li>
        <li>textContent</li>
        <li>textContent</li>
    </ul>
  </div>
</body>

<script>
  const Title = document.getElementById('title');
  const List = document.getElementById('list');
</script>

1) innerText

์š”์†Œ์˜ ํ…์ŠคํŠธ ์ฝ˜ํ…์ธ ์—๋งŒ ์ ‘๊ทผ ๋ฐ ์กฐ์ž‘

๐Ÿ“Œ์˜ˆ์‹œ

console.log(Title.innerText);  // This is the Title

Title.innerText = "<div style='color:red;'>JavaScript</div>";
// -> ํ…์ŠคํŠธ๋ฅผ ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅ

2) innerHTML

  • ํ•ด๋‹น ์š”์†Œ์˜ ๋ชจ๋“  ์ž์‹ ์š”์†Œ๋ฅผ ํฌํ•จํ•˜๋Š” ์ฝ˜ํ…์ธ ๋ฅผ ํ•˜๋‚˜์˜ ๋ฌธ์ž์—ด๋กœ ์ทจ๋“
  • ๋ฌธ์ž์—ด์€ ๋งˆํฌ์—…์„ ํฌํ•จ

๐Ÿ“Œ์˜ˆ์‹œ

console.log(List.innerHTML);  
/* <li>textContent</li>
   <li>textContent</li>
   <li>textContent</li> */

Title.innerHTML = "<div style='color:red;'>JavaScript</div>";
// -> ์Šคํƒ€์ผ์ด ์ ์šฉ๋œ ์ƒํƒœ๋กœ ์ถœ๋ ฅ

๐Ÿ’ญDOM ์š”์†Œ์˜ ์Šคํƒ€์ผ ์กฐ์ž‘

<body>
  <p id="text">Lorem ipsum</p>
  <button onclick="change()">๊ธ€์ž ์ƒ‰, ํฌ๊ธฐ ๋ณ€๊ฒฝ</button>
  <button onclick="reset()">์ดˆ๊ธฐํ™”</button>
</body>

style

  • inline ์Šคํƒ€์ผ ์„ ์–ธ์„ ์ƒ์„ฑ
  • '-'์œผ๋กœ ๊ตฌ๋ถ„๋˜๋Š” ์†์„ฑ ์ด๋ฆ„์€ ์นด๋ฉœ์ผ€์ด์Šค๋กœ ๋ณ€ํ™˜ํ•˜์—ฌ ์‚ฌ์šฉ

๐Ÿ“Œ์˜ˆ์‹œ

function change() {
    const Text = document.getElementById('text');
    Text.style.fontSize = '30px';
    Text.style.color = 'blue';
}

function reset() {
    const Text = document.getElementById('text');
    Text.style.fontSize = '16px';
    Text.style.color = 'black';
}
profile
#html #css #javascript

0๊ฐœ์˜ ๋Œ“๊ธ€