.ﺪﺷ ﺩﺎﺠﯾﺍ ﮓﯿﺳﺭ ﻥﺎﺟ ﻂﺳﻮﺗ 2006 ﻝﺎﺳ ﺭﺩ ﯼﺮﺋﻮﮐ ﯽﺟ
.ﺖﺳﺍ ﻩﺩﻮﺑ ﻥﺎﻬﺟ ﺭﺩ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻪﻧﺎﺨﺑﺎﺘﮐ ﻦﯾﺮﺗ ﺏﻮﺒﺤﻣ jQuery ،ﻝﺎﺳ 10 ﺯﺍ ﺶﯿﺑ ﯼﺍﺮﺑ
:ﺩﺮﮐ ﻞﺣ ﺩﺭﺍﺪﻧﺎﺘﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻂﺧ ﺪﻨﭼ ﺎﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ ﯼﺮﺋﻮﮐ ﯽﺟ ﯼﺎﻫﺭﺍﺰﺑﺍ ﺯﺍ ﯼﺭﺎﯿﺴﺑ ،(200
:HTML ﺮﺼﻨﻋ ﮏﯾ ﻑﺬﺣ
$("#id02").remove();
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>
<body>
<h2>Remove an HTML Element</h2>
<p id="id01">Hello World!</p>
<p id="id02">Hello Sweden!</p>
<script>
$(document).ready(function() {
$("#id02").remove();
});
</script>
</body>
</html>
document.getElementById("id02").remove();
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>Remove an HTML Element</h2>
<p id="id01">Hello World!</p>
<p id="id02">Hello Sweden!</p>
<script>
document.getElementById("id02").remove();
</script>
</body>
</html>
:ﺪﯿﻧﺍﺩﺮﮔﺮﺑ ﺍﺭ HTML ﺮﺼﻨﻋ ﮏﯾ ﺪﻟﺍﻭ
myParent = $("#02").parent().prop("nodeName"); ;
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>
<body>
<h2>Getting Parent HTML Element</h2>
<p id="01">Hello World!</p>
<p id="02">Hello Sweden!</p>
<p id="demo"></p>
<script>
$(document).ready(function() {
$("#demo").text($("#02").parent().prop("nodeName"));
});
</script>
</body>
</html>
myParent = document.getElementById("02").parentNode.nodeName;
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>Get Parent HTML Element</h2>
<p id="01">Hello World!</p>
<p id="02">Hello Sweden!</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = document.getElementById("02").parentNode.nodeName;
</script>
</body>
</html>