ﺩﺮﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺪﮐ ﺢﯿﺿﻮﺗ ﯼﺍﺮﺑ ﻥﺍﻮﺗ ﯽﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺕﺍﺮﻈﻧ ﺯﺍ
ﺩﻮﺷ ﻩﺩﺎﻔﺘﺳﺍ ﺍﺮﺟﺍ ﺯﺍ ﯼﺮﯿﮔﻮﻠﺟ ﯼﺍﺮﺑ ﺪﻧﺍﻮﺗ ﯽﻣ ﻦﯿﻨﭽﻤﻫ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺕﺍﺮﻈﻧ
.ﺩﻮﺷ ﯽﻣ ﻉﻭﺮﺷ //
ﺎﺑ ﯽﻄﺧ ﮏﺗ ﺕﺍﺮﻈﻧ
.ﺩﻮﺷ ﯽﻣ ﻪﺘﻓﺮﮔ ﻩﺪﯾﺩﺎﻧ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻂﺳﻮﺗ ﻂﺧ ﯼﺎﻬﺘﻧﺍ ﻭ //
ﻦﯿﺑ ﯽﻨﺘﻣ ﺮﻫ
:ﺪﻨﮐ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺪﮐ ﻂﺧ ﺮﻫ ﺯﺍ ﻞﺒﻗ ﯽﻄﺧ ﮏﺗ ﺮﻈﻧ ﮏﯾ ﺯﺍ ﻝﺎﺜﻣ ﻦﯾﺍ
// Change heading:
document.getElementById("myH").innerHTML = "My First Page";
// Change paragraph:
document.getElementById("myP").innerHTML = "My first paragraph.";
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h1 id="myH"></h1>
<p id="myP"></p>
<script>
// Change heading:
document.getElementById("myH").innerHTML = "JavaScript Comments";
// Change paragraph:
document.getElementById("myP").innerHTML = "My first paragraph.";
</script>
</body>
</html>
ﺪﻨﮐ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﻂﺧ ﺮﻫ ﯼﺎﻬﺘﻧﺍ ﺭﺩ ﯽﻄﺧ ﺮﻈﻧ ﮏﯾ ﺯﺍ ﻝﺎﺜﻣ ﻦﯾﺍ
let x = 5; // Declare x, give it the value of 5
let y = x + 2; // Declare y, give it the value of x + 2
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Comments</h2>
<p id="demo"></p>
<script>
let x = 5; // Declare x, give it the value of 5
let y = x + 2; // Declare y, give it the value of x + 2
// Write y to demo:
document.getElementById("demo").innerHTML = y;
</script>
</body>
</html>
.ﺪﻧﻮﺷﯽﻣ ﻢﺘﺧ */
ﺎﺑ ﻭ ﺪﻧﻮﺷﯽﻣ ﻉﻭﺮﺷ /*
ﺎﺑ ﯽﻄﺧ
.ﺩﻮﺷ ﯽﻣ ﻪﺘﻓﺮﮔ ﻩﺪﯾﺩﺎﻧ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻂﺳﻮﺗ */
ﻭ /*
ﻦﯿﺑ
:ﺪﻨﮐ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺪﮐ ﺢﯿﺿﻮﺗ ﯼﺍﺮﺑ (ﺮﻈﻧ ﮎﻮﻠﺑ ﮏﯾ) ﯽﻄﺧ ﺪﻨﭼ ﺮﻈﻧ ﮏﯾ ﺯﺍ ﻝﺎﺜﻣ ﻦﯾﺍ
/*
The code below will change
the heading with id = "myH"
and the paragraph with id = "myP"
in my web page:
*/
document.getElementById("myH").innerHTML = "My First Page";
document.getElementById("myP").innerHTML = "My first paragraph.";
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h1 id="myH"></h1>
<p id="myP"></p>
<script>
/*
The code below will change
the heading with id = "myH"
and the paragraph with id = "myP"
*/
document.getElementById("myH").innerHTML = "JavaScript Comments";
document.getElementById("myP").innerHTML = "My first paragraph.";
</script>
</body>
</html>
ﺪﻧﻮﺷ ﯽﻣ ﺩﻭﺪﺴﻣ ﺕﺍﺮﻈﻧ ﻻًﻮﻤﻌﻣ
.ﺖﺳﺍ ﺞﯾﺍﺭ ﯽﻄﺧ ﮏﺗ ﺕﺍﺮﻈﻧ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﻻًﻮﻤﻌﻣ
ﺖﺳﺍ ﺐﺳﺎﻨﻣ ﺪﮐ ﯼﺍﺮﺟﺍ ﺯﺍ ﯼﺮﯿﮔﻮﻠﺟ ﯼﺍﺮﺑ ﺕﺍﺮﻈﻧ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ
ﻪﺑ ﯽﯾﺍﺮﺟﺍ ﻂﺧ ﮏﯾ ﺯﺍ ﺍﺭ ﺪﮐ ﻁﻮﻄﺧ ،ﺪﮐ ﻂﺧ ﮏﯾ ﻞﺑﺎﻘﻣ ﺭﺩ //
ﻥﺩﻭﺰﻓﺍ
:ﺪﻨﮐ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺪﮐ ﻁﻮﻄﺧ ﺯﺍ ﯽﮑﯾ ﯼﺍﺮﺟﺍ ﺯﺍ ﯼﺮﯿﮔﻮﻠﺟ ﯼﺍﺮﺑ/ﺯﺍ ﻝﺎﺜﻣ ﻦﯾﺍ
//document.getElementById("myH").innerHTML = "My First Page";
document.getElementById("myP").innerHTML = "My first paragraph.";
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Comments</h2>
<h1 id="myH"></h1>
<p id="myP"></p>
<script>
//document.getElementById("myH").innerHTML = "My First Page";
document.getElementById("myP").innerHTML = "My first paragraph.";
</script>
<p>The line starting with // is not executed.</p>
</body>
</html>
ﺪﻨﮐ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﻥﺁ ﯼﺍﺮﺟﺍ ﺯﺍ ﯼﺮﯿﮔﻮﻠﺟ ﯼﺍﺮﺑ ﺮﻈﻧ ﮎﻮﻠﺑ ﮏﯾ ﺯﺍ ﻝﺎﺜﻣ ﻦﯾﺍ
/*
document.getElementById("myH").innerHTML = "My First Page";
document.getElementById("myP").innerHTML = "My first paragraph.";
*/
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Comments</h2>
<h1 id="myH"></h1>
<p id="myP"></p>
<script>
/*
document.getElementById("myH").innerHTML = "Welcome to my Homepage";
document.getElementById("myP").innerHTML = "This is my first paragraph.";
*/
document.getElementById("myP").innerHTML = "The comment-block is not executed.";
</script>
</body>
</html>