HTML ﺭﺩ) ﺪﯿﻫﺩ ﻡﺎﺠﻧﺍ ﺪﯿﻧﺍﻮﺗﯽﻣ ﻪﮐ ﺪﻨﺘﺴﻫ ﯽﯾﺎﻫﺩﺮﮑﻠﻤﻋ
ﺪﯿﻧﺍﻮﺗ ﯽﻣ ﻪﮐ ﺪﻨﺘﺴﻫ (HTML ﺮﺻﺎﻨﻋ ﺯﺍ) ﺮﯾﺩﺎﻘﻣ
HTML DOM ﺖﺳﺍ ﯽﺳﺮﺘﺳﺩ ﻞﺑﺎﻗ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺎﺑ
.ﺪﻧﻮﺷ ﯽﻣ ﻒﯾﺮﻌﺗ ءﺎﯿﺷﺍ ﻥﺍﻮﻨﻋ ﻪﺑ HTML ﺮﺻﺎﻨﻋ ﻡﺎﻤﺗ ،DOM ﺭﺩ
ﺖﺳﺍ ﯽﺴﯾﻮﻧ ﻪﻣﺎﻧﺮﺑ ﻂﺑﺍﺭ
ﯽﮔﮋﯾﻭ ﯽﻣ ﻪﮐ ﺖﺳﺍ ﯼﺭﺍﺪﻘﻣﻥﺁ ﺮﯿﯿﻐﺗ ﺪﻨﻧﺎﻣ) ﺪﯿﻨﮐ ﻢﯿﻈﻨﺗ ﺎﯾ ﺖﻓﺎﯾﺭﺩ ﺪﯿﻧﺍﻮﺗ
ﺵﻭﺭ ﻥﺩﻭﺰﻓﺍ ﺪﻨﻧﺎﻣ) ﺪﯿﻫﺩ ﻡﺎﺠﻧﺍ ﺪﯿﻧﺍﻮﺗ ﯽﻣ ﻪﮐ ﺖﺳﺍ ﯽﻣﺍﺪﻗﺍ
: → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ ﻝﺎﺜﻣ
<html>
<body>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = "Hello World!";
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>My First Page</h2>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = "Hello World!";
</script>
</body>
</html>
ﺖﺳﺍ ﺵﻭﺭ ﮏﯾ ﻦﺘﻓﺎﯾ ﯼﺍﺮﺑ .ﺖﺳﺍ .ﺖﺳﺍ ﺪﯿﻔﻣ HTML ﺮﺻﺎﻨﻋ ﯼﺍﻮﺘﺤﻣ ﯽﻨﯾﺰﮕﯾﺎﺟ ﺎﯾ ﺖﻓﺎﯾﺭﺩ ﯼﺍﺮﺑ ،ﺩﺮﮐ ﻩﺩﺎﻔﺘﺳﺍ HTML ﺮﺼﻨﻋ ﺮﻫ ﺮﯿﯿﻐﺗ ﺎﯾ ﺖﻓﺎﯾﺭﺩ ﯼﺍﺮﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ innerHTML
ﻪﮐ ﯽﻟﺎﺣ ﺭﺩ ،ﺖﺳﺍ ﺵﻭﺭ getElementById ﺪﺘﻣ
id
ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ HTML ﺮﺼﻨﻋ ﮏﯾ ﻪﺑ ﯽﺳﺮﺘﺳﺩ ﯼﺍﺮﺑ ﻩﺍﺭ ﻦﯾﺮﺗ ﺞid="demo"
ﺯﺍ ge
innerHTML ﯽﮔﮋﯾﻭ
innerHTML
ﯽﮔﮋﯾﻭ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺮﺼﻨﻋ ﮏﯾ ﯼﺍﻮﺘﺤﻣ ﺖﻓﺎﯾﺭinnerHT
i