![μ
λ‘λμ€..]()
π¨βπ»Β μ¬κ±΄
β
Β ν΄κ²°
- textContent λ λ°λ‘ λ λλ§μ κ±°μΉμ§μκ³ λνλ΄κ³ , innerTextλ νλ² λ λλ§μ κ±°μ³μ μ°λ¦¬κ° λ³Ό μ μλ λ΄μ©λ§μ νμν΄ μ€λλ€. ( μ‘°κΈ λ λΉ λ₯Έ νμ΄μ§ λ λλ§μ μν΄μ textContent λ₯Ό μ°μ μ μΌλ‘ μ¬μ© ν νμκ° μμ )
<p id="txtP">
hell<br>o
<span style="display: none">hello</span>
</p>
console.log(txtP.textContent);
console.log(txtP.innerText);
πΒ κ°μ
- μν©μ λ§λ λͺ
λ Ήμ΄λ₯Ό μ¬μ©ν΄μΌ νλ€.