ﯼﺮﺋﻮﮐ ﯽﺟ ﯼﺎﻫﺮﮕﺑﺎﺨﺘﻧﺍ


فهرست مطالب

    نمایش فهرست مطالب


ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻞﺑﺎﻘﻣ ﺭﺩ ﯼﺮﺋﻮﮐ ﯽﺟ

.ﺪﺷ ﺩﺎﺠﯾﺍ ﮓﯿﺳﺭ ﻥﺎﺟ ﻂﺳﻮﺗ 2006 ﻝﺎﺳ ﺭﺩ ﯼﺮﺋﻮﮐ ﯽﺟ

.ﺖﺳﺍ ﻩﺩﻮﺑ ﻥﺎﻬﺟ ﺭﺩ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻪﻧﺎﺨﺑﺎﺘﮐ ﻦﯾﺮﺗ ﺏﻮﺒﺤﻣ jQuery ،ﻝﺎﺳ 10 ﺯﺍ ﺶﯿﺑ ﯼﺍﺮﺑ

:ﺩﺮﮐ ﻞﺣ ﺩﺭﺍﺪﻧﺎﺘﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻂﺧ ﺪﻨﭼ ﺎﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ ﯼﺮﺋﻮﮐ ﯽﺟ ﯼﺎﻫﺭﺍﺰﺑﺍ ﺯﺍ ﯼﺭﺎﯿﺴﺑ ،(200


ﻪﺳﺎﻨﺷ ﺎﺑ HTML ﺮﺼﻨﻋ ﻦﺘﻓﺎﯾ

:ﺪﯿﻧﺍﺩﺮﮔﺮﺑ "id="id01 ﺎﺑ ﺍﺭ ﺮﺼﻨﻋ

ﯼﺮﺋﻮﮐ ﯽﺟ

myElement = $("#id01");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>
<body>

<h2>Finding HTML Elements by Id</h2>
<p id="id01">Hello World!</p>
<p id="id02">Hello Sweden!</p>
<p id="id03">Hello Japan!</p>

<p id="demo"></p>

<script>
$(document).ready(function() {
  var myElements = $("#id01");
  $("#demo").text("The text from the id01 paragraph is: " + myElements[0].innerHTML);
});
</script>

</body>
</html>

ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

myElement = document.getElementById("id01");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>Finding HTML Elements by Id</h2>
<p id="id01">Hello World!</p>
<p id="id02">Hello Sweden!</p>
<p id="id03">Hello Japan!</p>

<p id="demo"></p>

<script>
const myElement = document.getElementById("id01");
document.getElementById("demo").innerHTML = "The text from the id01 paragraph is: " + myElement.innerHTML;
</script>

</body>
</html>

ﮓﺗ ﻡﺎﻧ ﺱﺎﺳﺍ ﺮﺑ HTML ﺮﺻﺎﻨﻋ ﻦﺘﻓﺎﯾ

:ﺪﯿﻧﺍﺩﺮﮔﺮﺑ ﺍﺭ <p> ﺮﺻﺎﻨﻋ ﻪﻤﻫ

ﯼﺮﺋﻮﮐ ﯽﺟ

myElements = $("p");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>

<body>

<h2>Finding HTML Elements by Tag Name</h2>

<p>Hello World!</p>
<p>Hello Sweden!</p>
<p>Hello Japan!</p>

<p id="demo"></p>

<script>
$(document).ready(function() {
  var myElements = $("p");
  $("#demo").text("The text in the first paragraph is: " + myElements[0].innerHTML);
});
</script>

</body>
</html>

ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

myElements = document.getElementsByTagName("p");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>Finding HTML Elements by Tag Name</h2>
<p>Hello World!</p>
<p>Hello Sweden!</p>
<p>Hello Japan!</p>

<p id="demo"></p>

<script>
const myElements = document.getElementsByTagName("p");
document.getElementById("demo").innerHTML = "The text in the first paragraph is: " + myElements[0].innerHTML;
</script>

</body>
</html>


ﺱﻼﮐ ﻡﺎﻧ ﺱﺎﺳﺍ ﺮﺑ HTML ﺮﺻﺎﻨﻋ ﻦﺘﻓﺎﯾ

.ﺪﯿﻧﺍﺩﺮﮔﺮﺑ "class="intro ﺎﺑ ﺍﺭ ﺮﺻﺎﻨﻋ ﻪﻤﻫ

ﯼﺮﺋﻮﮐ ﯽﺟ

myElements = $(".intro");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>
<body>

<h2>Finding HTML Elements by Class Name</h2>

<p class="intro">Hello World!</p>
<p class="intro">Hello Sweden!</p>
<p class="intro">Hello Japan!</p>

<p id="demo"></p>

<script>
$(document).ready(function() {
  var myElements = $(".intro");
  $("#demo").text("The first paragraph with class='intro' is: " + myElements[0].innerHTML);
});
</script>

</body>
</html>

ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

myElements = document.getElementsByClassName("intro");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>Finding HTML Elements by Class Name</h2>
<p class="intro">Hello World!</p>
<p class="intro">Hello Sweden!</p>
<p class="intro">Hello Japan!</p>

<p id="demo"></p>

<script>
const myElements = document.getElementsByClassName("intro");
document.getElementById("demo").innerHTML = "The first paragraph with class='intro' is: " + myElements[0].innerHTML;
</script>

</body>
</html>

CSS ﯼﺎﻫﺮﮕﺑﺎﺨﺘﻧﺍ ﻂﺳﻮﺗ HTML ﺮﺻﺎﻨﻋ ﻦﺘﻓﺎﯾ

.ﺪﯿﻧﺍﺩﺮﮔﺮﺑ "class="intro ﺎﺑ ﺍﺭ <p> ﺮﺻﺎﻨﻋ ﻡﺎﻤﺗ ﺯﺍ ﯽﺘﺳﺮﻬﻓ

ﯼﺮﺋﻮﮐ ﯽﺟ

myElements = $("p.intro");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>
<body>

<h2>Finding HTML Elements by Query Selector</h2>

<p class="intro">Hello World!</p>
<p class="intro">Hello Sweden!</p>
<p class="intro">Hello Japan!</p>

<p id="demo"></p>

<script>
$(document).ready(function() {
  var myElements = $("p.intro");
  $("#demo").text("The first paragraph with class='intro' is: " + myElements[0].innerHTML);
});
</script>

</body>
</html>

ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

myElements = document.querySelectorAll("p.intro");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>Finding HTML Elements by Query Selector</h2>
<p class="intro">Hello World!</p>
<p class="intro">Hello Sweden!</p>
<p class="intro">Hello Japan!</p>

<p id="demo"></p>

<script>
const myElements = document.querySelectorAll("p.intro");
document.getElementById("demo").innerHTML = 
"The first paragraph with class='intro' is: " + myElements[0].innerHTML;
</script>

</body>
</html>