ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯼﺎﻫﺩﺍﺪﯾﻭﺭ


فهرست مطالب

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


.ﺪﻨﺘﻓﺍﯽﻣ ﻕﺎﻔﺗﺍ HTML ﺮﺻﺎﻨﻋ ﯼﺍﺮﺑ ﻪﮐ ﺪﻨﺘﺴﻫ «ﯽﯾﺎﻫﺰﯿﭼ»

ﺪﻧﺍﻮﺗ ﯽﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ،ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ HTML ﺕﺎﺤﻔﺻ ﺭﺩ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻪﮐ ﯽﻣﺎﮕﻨﻫ


HTML ﯼﺎﻫﺩﺍﺪﯾﻭﺭ

.ﺪﻫﺩ ﯽﻣ ﻡﺎﺠﻧﺍ ﺮﺑﺭﺎﮐ ﻪﮐ ﯼﺭﺎﮐ ﺎﯾ ﺪﻫﺩ ﯽﻣ ﻡﺎﺠﻧﺍ ﺮﮔﺭﻭﺮﻣ ﻪﮐ ﺪﺷﺎﺑ ﯼﺭﺎﮐ ﺪﻧﺍﻮﺗ ﯽﻣ HTML ﺩﺍﺪﯾﻭﺭ ﮏﯾ

:ﺖﺳﺍ ﻩﺪﺷ ﻩﺩﺭﻭﺁ HTML ﯼﺎﻫﺩﺍﺪﯾﻭﺭ ﺯﺍ ﻪﻧﻮﻤﻧ ﺪﻨﭼ ﺎﺠﻨﯾﺍ ﺭﺩ

  • ﺖﺳﺍ ﻩﺪﺷ ﯼﺮﯿﮔﺭﺎﺑ HTML ﺏﻭ ﻪﺤﻔﺻ ﮏﯾ

  • ﺩﺮﮐ ﺮﯿﯿﻐﺗ HTML ﯼﺩﻭﺭﻭ ﺪﻠﯿﻓ ﮏﯾ

  • ﺪﺷ ﮏﯿﻠﮐ HTML ﻪﻤﮐﺩ ﮏﯾ

.ﺪﯿﻫﺩ ﻡﺎﺠﻧﺍ ﯼﺭﺎﮐ ﺪﯿﻫﺍﻮﺨﺑ ﺖﺳﺍ ﻦﮑﻤﻣ ،ﺪﻫﺩ ﯽﻣ ﺥﺭ ﯽﺗﺎﻗﺎﻔﺗﺍ ﻪﮐ ﯽﻧﺎﻣﺯ ،ﺐﻠﻏﺍ

.ﺪﯿﻨﮐ ﺍﺮﺟﺍ ﺍﺭ ﺪﮐ ،ﺪﻧﻮﺷ ﯽﻣ ﯽﯾﺎﺳﺎﻨﺷ ﺎﻫﺩﺍﺪﯾﻭﺭ ﻪﮐ ﯽﻧﺎﻣﺯ ﺎﺗ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

HTML ﺩﺍﺪﯾﻭﺭ ﻩﺪﻨﻨﮐ ﻝﺮﺘﻨﮐ ﯼﺎﻫ ﯽﮔﮋﯾﻭ ﺎﺗ ﺪﻫﺩ ﯽﻣ ﻩﺯﺎﺟﺍ، ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺪﮐ ﺎﺑ، ﺮﺻﺎﻨﻋ ﻪﺑ HTML ﺪﻧﻮﺷ ﻪﻓﺎﺿﺍ.

:ﮏﺗ ﻝﻮﻗ ﻞﻘﻧ ﺎﺑ

<element
 event='some JavaScript'>

:ﻝﻮﻗ ﻞﻘﻧ ﻭﺩ ﺎﺑ

<element
 event="some JavaScript">

.ﺖﺳﺍ ﻩﺪﺷ ﻪﻓﺎﺿﺍ ﯽﮔﮋﯾﻭ ﮏﯾ ﻪﺑ ،(ﺪﮐ ﺎﺑ) onclick ﯽﮔﮋﯾﻭ ﮏﯾ ،ﺮﯾﺯ ﻝﺎﺜﻣ ﺭﺩ

ﻝﺎﺜﻣ

<button onclick="document.getElementById('demo').innerHTML = Date()">The time is?</button>

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

<!DOCTYPE html>
<html>
<body>

<button onclick="document.getElementById('demo').innerHTML=Date()">The time is?</button>

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

</body>
</html>

ﺪﻫﺩ ﯽﻣ ﺮﯿﯿﻐﺗ ﺍﺭ ﻥﺁ ﯼﺍﻮﺘﺤﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺪﮐ ،ﻻﺎﺑ ﻝﺎﺜﻣ ﺭﺩ

ﺪﻫﺩ ﯽﻣ ﺮﯿﯿﻐﺗ ﺍﺭ ﻥﺁ ﯼﺍﻮﺘﺤﻣ ﺪﮐ ،ﯼﺪﻌﺑ ﻝﺎﺜﻣ ﺭﺩ

ﻝﺎﺜﻣ

<button onclick="this.innerHTML = Date()">The time is?</button>

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

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript HTML Events</h2>
<button onclick="this.innerHTML=Date()">The time is?</button>

</body>
</html>

:ﻢﯿﻨﮐ ﻩﺪﻫﺎﺸﻣ ﻊﺑﺍﻮﺗ ﯽﻧﺍﻮﺧﺍﺮﻓ ﺍﺭ ﺩﺍﺪﯾﻭﺭ ﯼﺎﻫ ﯽﮔﮋﯾﻭ ﻪﮐ ﺖﺳﺍ ﻝﻭﺍﺪﺘﻣ ﺮﺘﺸﯿﺑ .ﺩﺭﺍﺩ ﻝﻮﻃ ﻂﺧ ﻦﯾﺪﻨﭼ ﺐﻠﻏﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺪﮐ

ﻝﺎﺜﻣ

<button onclick="displayDate()">The time is?</button>

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

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript HTML Events</h2>
<p>Click the button to display the date.</p>

<button onclick="displayDate()">The time is?</button>

<script>
function displayDate() {
  document.getElementById("demo").innerHTML = Date();
}
</script>

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

</body>
</html> 


HTML ﺞﯾﺍﺭ ﯼﺎﻫﺩﺍﺪﯾﻭﺭ

:ﺖﺳﺍ ﻩﺪﻣﺁ HTML ﺞﯾﺍﺭ ﯼﺎﻫﺩﺍﺪﯾﻭﺭ ﯽﺧﺮﺑ ﺯﺍ ﯽﺘﺴﯿﻟ ﺎﺠﻨﯾﺍ ﺭﺩ

onchange

ﺖﺳﺍ ﻩﺩﺮﮐ ﺮﯿﯿﻐﺗ HTML ﺮﺼﻨﻋ ﮏﯾ

onclick

ﺪﻨﮐ ﯽﻣ ﮏﯿﻠﮐ HTML ﺮﺼﻨﻋ ﮏﯾ ﯼﻭﺭ ﺮﺑﺭﺎﮐ

onmouseover

ﺪﻫﺩ ﯽﻣ ﺖﮐﺮﺣ HTML ﺮﺼﻨﻋ ﮏﯾ ﯼﻭﺭ ﺍﺭ ﺱﻮﻣ ﺮﺑﺭﺎﮐ

onmouseout

ﺪﻨﮐ ﯽﻣ ﺭﻭﺩ HTML ﺮﺼﻨﻋ ﮏﯾ ﺯﺍ ﺍﺭ ﺱﻮﻣ ﺮﺑﺭﺎﮐ

onkeydown

ﺪﻫﺩ ﯽﻣ ﺭﺎﺸﻓ ﺍﺭ ﺪﯿﻠﮐ ﻪﺤﻔﺻ ﺪﯿﻠﮐ ﮏﯾ ﺮﺑﺭﺎﮐ

onload

ﺖﺳﺍ ﻩﺪﻧﺎﺳﺭ ﻥﺎﯾﺎﭘ ﻪﺑ ﺍﺭ ﻪﺤﻔﺻ ﯼﺮﯿﮔﺭﺎﺑ ﺮﮔﺭﻭﺮﻣ

.W3Schools JavaScript Reference HTML DOM Events :ﺖﺳﺍ ﺮﺗ ﯽﻧﻻﻮﻃ ﺭﺎﯿﺴﺑ ﺖﺳﺮﻬﻓ


ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺩﺍﺪﯾﻭﺭ ﻩﺪﻨﻨﮐ ﻝﺮﺘﻨﮐ

،ﺮﺑﺭﺎﮐ ﺕﺎﻣﺍﺪﻗﺍ ،ﺮﺑﺭﺎﮐ ﯼﺩﻭﺭﻭ ﺪﯿﯾﺄﺗ ﻭ ﺖﯾﺮﯾﺪﻣ ﯼﺍﺮﺑ ﺪﻨﻧﺍﻮﺗﯽﻣ ﺩﺍﺪﯾﻭﺭ ﯼﺎﻫﻩﺪﻨﻨﮐﻝﺮﺘﻨﮐ

  • ﺪﯿﻫﺩ ﻡﺎﺠﻧﺍ ﺩﻮﺷ ﯽﻣ ﯼﺭﺍﺬﮔﺭﺎﺑ ﻪﺤﻔﺻ ﮏﯾ ﻪﮐ ﺭﺎﺑ ﺮﻫ ﺪﯾﺎﺑ ﻪﮐ ﯽﯾﺎﻫﺭﺎﮐ

  • ﺩﻮﺷ ﻡﺎﺠﻧﺍ ﻪﺤﻔﺻ ﻥﺪﺷ ﻪﺘﺴﺑ ﻥﺎﻣﺯ ﺭﺩ ﺪﯾﺎﺑ ﻪﮐ ﯽﯾﺎﻫﺭﺎﮐ

  • ﺩﻮﺷ ﻡﺎﺠﻧﺍ ﺪﻨﮐ ﯽﻣ ﮏﯿﻠﮐ ﯼﺍ ﻪﻤﮐﺩ ﯼﻭﺭ ﺮﺑﺭﺎﮐ ﻪﮐ ﯽﻧﺎﻣﺯ ﺪﯾﺎﺑ ﻪﮐ ﯽﻣﺍﺪﻗﺍ

  • ﺩﻮﺷ ﺪﯿﯾﺄﺗ ﺮﺑﺭﺎﮐ ﻂﺳﻮﺗ ﻩﺩﺍﺩ ﻥﺩﺮﮐ ﺩﺭﺍﻭ ﻡﺎﮕﻨﻫ ﺪﯾﺎﺑ ﻪﮐ ﯽﯾﺍﻮﺘﺤﻣ

  • ... ﺮﺘﺸﯿﺑ ﻭ

:ﺩﺮﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺎﻫﺩﺍﺪﯾﻭﺭ ﺎﺑ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻪﺑ ﻥﺩﺍﺩ ﻩﺯﺎﺟﺍ ﯼﺍﺮﺑ ﻥﺍﻮﺗﯽﻣ ﺍﺭ ﯽﻔﻠﺘﺨﻣ ﯼﺎﻫﺵﻭﺭ

  • ﺪﻨﻨﮐ ﺍﺮﺟﺍ ﺎًﻤﯿﻘﺘﺴﻣ ﺍﺭ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺪﮐ ﺪﻨﻧﺍﻮﺗ ﯽﻣ HTML ﺩﺍﺪﯾﻭﺭ ﯼﺎﻫ ﯽﮔﮋﯾﻭ

  • ﺪﻨﻨﮐ ﯽﻧﺍﻮﺧﺍﺮﻓ ﺍﺭ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻊﺑﺍﻮﺗ ﺪﻨﻧﺍﻮﺗ ﯽﻣ HTML ﺩﺍﺪﯾﻭﺭ ﯼﺎﻫ ﯽﮔﮋﯾﻭ

  • ﺪﯿﻫﺩ ﺹﺎﺼﺘﺧﺍ HTML ﺮﺻﺎﻨﻋ ﻪﺑ ﺍﺭ ﺩﻮﺧ ﺩﺍﺪﯾﻭﺭ ﺖﯾﺮﯾﺪﻣ ﻊﺑﺍﻮﺗ ﺪﯿﻧﺍﻮﺗ ﯽﻣ ﺎﻤﺷ

  • ﺪﯿﻨﮐ ﯼﺮﯿﮔﻮﻠﺟ ﺎﻫﺩﺍﺪﯾﻭﺭ ﻪﺑ ﯽﮔﺪﯿﺳﺭ ﺎﯾ ﻝﺎﺳﺭﺍ ﺯﺍ ﺪﯿﻧﺍﻮﺗ ﯽﻣ

  • ... ﺮﺘﺸﯿﺑ ﻭ

.ﺖﺧﻮﻣﺁ ﺪﯿﻫﺍﻮﺧ ﺩﺍﺪﯾﻭﺭ ﯼﺎﻫ ﻩﺪﻨﻨﮐ ﻝﺮﺘﻨﮐ ﻭ ﺎﻫﺩﺍﺪﯾﻭﺭ ﺩﺭﻮﻣ ﺭﺩ ﯼﺮﺘﺸﯿﺑ ﺕﺎﻋﻼﻃﺍ HTML DOM ﯼﺎﻫ ﻞﺼﻓ ﺭﺩ



تمامی حقوق محفوظ است. © BasicIT.org • 2023-2024