কম্পিউটার টিউটোরিয়াল

HTML-এ একটি এলিমেন্টের স্ক্রোলবার স্ক্রোল হলে স্ক্রিপ্ট কীভাবে এক্সিকিউট করবেন?

যখন একটি এলিমেন্ট স্ক্রোল করা হয়, তখন onscroll অ্যাট্রিবিউটটি ট্রিগার হয়। নিচের কোডটি চালিয়ে onscroll অ্যাট্রিবিউটের ব্যবহার দেখুন:

উদাহরণ

<!DOCTYPE html> <html>    <head>       <style>          #myid {             width   : 250px;             height  : 80px;             border  : 2px solid blue;             overflow: scroll;          }       </style>    </head>    <body>       <p>Scroll the box.</p>       <div id = "myid" onscroll = "display()">This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text.       <br><br></div>       <script>          function display() {             document.getElementById("myid").style.color = "blue";          }       </script>    </body> </html>
  1. HTML-এ একটি এলিমেন্ট ফোকাস হারালে স্ক্রিপ্ট কীভাবে এক্সিকিউট করবেন?

  2. HTML-এ ব্যবহারকারী একটি এলিমেন্টে কন্টেন্ট পেস্ট করলে স্ক্রিপ্ট কীভাবে এক্সিকিউট করবেন?

  3. HTML-এ এলিমেন্টে ক্লিক হলে স্ক্রিপ্ট চালানো

  4. HTML-এ এলিমেন্ট ফোকাস পেলে স্ক্রিপ্ট চালানো