اÛÙ Ù
ØØªÙا تÙÙØ§ در اÛ٠زباÙâÙØ§ Ù
ÙØ¬Ùد است: ÄeÅ¡tina, Dansk, English, Español, Français, Indonesia, Italiano, æ¥æ¬èª, íêµì´, Ð ÑÑÑкий, Türkçe, УкÑаÑнÑÑка, OÊ»zbek, ç®ä½ä¸æ. ÙØ·Ùا٠ب٠Ù
ا
createTextNode vs innerHTML vs textContent
اÙÙ
ÛØª: 5
We have an empty DOM element elem and a string text.
Which of these 3 commands will do exactly the same?
elem.append(document.createTextNode(text))elem.innerHTML = textelem.textContent = text
Answer: 1 and 3.
Both commands result in adding the text âas textâ into the elem.
Hereâs an example: