:ﺪﻫﺩ "ﺶﯾﺎﻤﻧ" ﻒﻠﺘﺨﻣ ﯼﺎﻫ ﺵﻭﺭ ﻪﺑ ﺍﺭ ﺎﻫ ﻩﺩﺍﺩ ﺪﻧﺍﻮﺗ ﯽﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ
.innerHTML
ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ،HTML ﺮﺼﻨﻋ ﮏﯾ ﺭﺩ ﻦﺘﺷﻮﻧ
.document.write()
ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ HTML ﯽﺟﻭﺮﺧ ﺭﺩ ﻦﺘﺷﻮﻧ
.window.alert()
ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ،ﺭﺍﺪﺸﻫ ﻪﺒﻌﺟ ﺭﺩ ﻦﺘﺷﻮﻧ
.console.log()
ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ،ﺮﮔﺭﻭﺮﻣ ﻝﻮﺴﻨﮐ ﺭﺩ ﻦﺘﺷﻮﻧ
innerHTML
ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ.ﺪﻨﮐ ﻩﺩﺎﻔﺘﺳﺍ document.getElementById(id)
ﺵﻭﺭ ﺯﺍ ﺪﻧﺍﻮﺗ ﯽﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ،HTML ﺮﺼﻨﻋ ﮏﯾ
:ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ ﺍﺭ HTML ﯼﺍﻮﺘﺤﻣ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ HTML ﺮﺼﻨﻋ ﮏﯾ innerHTML ﯽﮔﮋﯾﻭ ﺮﯿﯿﻐﺗ :ﺖﺳﺍ ﺖﺣﺍﺭ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ :ﺪﻨﮐ ﯽﻣ ﻑﺬﺣ ﺍﺭ ﺩﻮﺟﻮﻣ HTML ﻪﻤﻫ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ .ﺩﻮﺷ ﻩﺩﺎﻔﺘﺳﺍ ﺶﯾﺎﻣﺯﺁ ﯼﺍﺮﺑ ﺪﯾﺎﺑ ﻂﻘﻓ()document.write ﺪﺘﻣ :ﺪﯿﻨﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺭﺍﺪﺸﻫ ﻪﺒﻌﺟ ﺯﺍ ﺪﯿﻧﺍﻮﺗ ﯽﻣ ﺎﻫ ﻩﺩﺍﺩ ﺶﯾﺎﻤﻧ ﯼﺍﺮﺑ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ .ﺪﯿﻨﮐ ﺮﻈﻧ ﻑﺮﺻ .ﺪﻨﺘﺴﻫ ﻩﺮﺠﻨﭘ ﯽﺷ ﻪﺑ ﻖﻠﻌﺘﻣ ﺽﺮﻓ ﺶﯿﭘ ﺭﻮﻃ ﻪﺑ ﺎﻫﺪﺘﻣ ﻭ ﺎﻫ ﯽﮔﮋﯾﻭ ،ﺎﻫﺮﯿﻐﺘﻣ ﻪﮐ ﺖﺳﺍ ﯽﻨﻌﻣ ﻥﺍﺪﺑ ﻦﯾﺍ .ﺖﺳﺍ ﯽﻧﺎﻬﺟ ﻪﻨﻣﺍﺩ ءﯽﺷ ،ﻩﺮﺠﻨﭘ ﯽﺷ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ .ﺪﯿﻨﮐ ﯽﻧﺍﻮﺧﺍﺮﻓ ﺍﺭ .ﺖﺧﻮﻣﺁ ﺪﯿﻫﺍﻮﺧ ﯽﯾﺍﺩﺯ ﻝﺎﮑﺷﺍ ﺩﺭﻮﻣ ﺭﺩ ﺮﺘﺸﯿﺑ ﺪﻌﺑ ﻞﺼﻓ ﺭﺩ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ .ﺩﺭﺍﺪﻧ ﯽﭘﺎﭼ ﺵﻭﺭ ﺎﯾ ﯽﭘﺎﭼ ءﯽﺷ ﭻﯿﻫ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ .ﺪﯿﺷﺎﺑ ﻪﺘﺷﺍﺩ ﯽﺳﺮﺘﺳﺩ ﯽﺟﻭﺮﺧ ﯼﺎﻫ ﻩﺎﮕﺘﺳﺩ ﻪﺑ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺯﺍ ﺪﯿﻧﺍﻮﺗ ﯽﻤﻧ ﺎﻤﺷ ﺭﺩ ﺍﺭ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧinnerHTML
ﯽﮔﮋﯾﻭ .ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ ﺍﺭ HTML ﺮﺼﻨﻋ ﻝﺎﺜﻣ
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My First Paragraph</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = 5 + 6;
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>My First Web Page</h2>
<p>My First Paragraph.</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = 5 + 6;
</script>
</body>
</html>
document.write()
ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑdocument.write()
ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ،ﯽﺸﯾﺎﻣﺯﺁ ﻑﺍﺪﻫﺍ ﯼﺍﺮﺑ ﻝﺎﺜﻣ
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<script>
document.write(5 + 6);
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>My First Web Page</h2>
<p>My first paragraph.</p>
<p>Never call document.write after the document has finished loading.
It will overwrite the whole document.</p>
<script>
document.write(5 + 6);
</script>
</body>
</html>
ﻝﺎﺜﻣ
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<button type="button" onclick="document.write(5 + 6)">Try it</button>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>My First Web Page</h2>
<p>My first paragraph.</p>
<button type="button" onclick="document.write(5 + 6)">Try it</button>
</body>
</html>
window.alert()
ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﻝﺎﺜﻣ
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<script>
window.alert(5 + 6);
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>My First Web Page</h2>
<p>My first paragraph.</p>
<script>
window.alert(5 + 6);
</script>
</body>
</html>
ﻩﺮﺠﻨﭘ<"code class="w3-codespan> ﯼﺪﯿﻠﮐ ﻪﻤﻠﮐ ﺯﺍ ﺪﯿﻧﺍﻮﺗ ﯽﻣ
ﻝﺎﺜﻣ
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<script>
alert(5 + 6);
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>My First Web Page</h2>
<p>My first paragraph.</p>
<script>
alert(5 + 6);
</script>
</body>
</html>
console.log()
ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑconsole.log()
ﺵﻭﺭ ﺪﯿﻧﺍﻮﺗﯽﻣ ،ﯽﯾﺍﺩﺯﻝﺎﮑﺷﺍ ﻑﺍﺪﻫﺍ ﯼﺍﺮﺑ ﻝﺎﺜﻣ
<!DOCTYPE html>
<html>
<body>
<script>
console.log(5 + 6);
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>Activate Debugging</h2>
<p>F12 on your keyboard will activate debugging.</p>
<p>Then select "Console" in the debugger menu.</p>
<p>Then click Run again.</p>
<script>
console.log(5 + 6);
</script>
</body>
</html>
ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﭖﺎﭼ
window.print()
ﺪﺘﻣ ﺪﯿﻧﺍﻮﺗ ﯽﻣ ﻪﮐ ﺖﺳﺍ ﻦﯾﺍ ﺎﻨﺜﺘﺳﺍ ﺎﻬﻨﺗ ﻝﺎﺜﻣ
<!DOCTYPE html>
<html>
<body>
<button onclick="window.print()">Print this page</button>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>The window.print() Method</h2>
<p>Click the button to print the current page.</p>
<button onclick="window.print()">Print this page</button>
</body>
</html>