কম্পিউটার

এইচটিএমএল উইন্ডো স্ব-সম্পত্তি


HTML উইন্ডো স্ব-সম্পত্তি ব্রাউজারের বর্তমান উইন্ডোটি প্রদান করে।

সিনট্যাক্স

নিচের সিনট্যাক্স −

window.self

আসুন HTML উইন্ডো সেলফ প্রপার্টি -

এর একটি উদাহরণ দেখি

উদাহরণ

<!DOCTYPE html>
<html>
<style>
   body {
      color: #000;
      height: 100vh;
      background-color: #8BC6EC;
      background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%) no-repeat;
      text-align: center;
   }
   .btn {
      background: #db133a;
      border: none;
      height: 2rem;
      border-radius: 2px;
      width: 30%;
      display: block;
      color: #fff;
      outline: none;
      cursor: pointer;
      margin: 1rem auto;
   }
   .show{
      font-size:1.2rem;
   }
</style>
<body>
<h1>HTML Window self Property Demo</h1>
<button onclick="create()" class="btn">Check current window is topmost using self property</button>
<div class="show"></div>
<script>
   function create(){
      if(window.top === window.self){
         document.querySelector('.show').innerHTML='The current window is the topmost window';
      } else{
         document.querySelector('.show').innerHTML='The current window is not the topmost window';
      }
   }
</script>
</body>
</html>

আউটপুট

এইচটিএমএল উইন্ডো স্ব-সম্পত্তি

চেক বর্তমান উইন্ডোটি সর্বোচ্চ স্ব-সম্পত্তি ব্যবহার করে ক্লিক করুন " বর্তমান উইন্ডোটি সবচেয়ে উপরের উইন্ডো কিনা তা পরীক্ষা করতে এবং কিভাবে স্ব-সম্পত্তি কাজ করে তা বোঝার জন্য বোতাম -

এইচটিএমএল উইন্ডো স্ব-সম্পত্তি


  1. HTML DOM উইন্ডো ওপেনার প্রপার্টি

  2. HTML DOM উইন্ডো ফ্রেম সম্পত্তি

  3. HTML DOM উইন্ডো ফ্রেম এলিমেন্ট প্রপার্টি

  4. HTML DOM উইন্ডো বন্ধ সম্পত্তি