সিনট্যাক্স
নিচে সিনট্যাক্স দেওয়া হলো:
window.moveTo(x, y)
এখানে, x এবং y উল্টে কৰ্মে উইন্ডোর অনুভূমিক এবং লম্বিক সচলন পিক্সেল-এ নির্দেশ করে।
উদাহরণ
<!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: 40%; display: block; color: #fff; outline: none; cursor: pointer; margin: 1rem auto; } </style> <body> <h1>HTML Window moveTo() মেথড ডেমো</h1> <button onclick="create()" class="btn">নতুন উইন্ডো তৈরি করুন এবং সরান</button> <script> function create(){ var newWindow = window.open('', '', 'width=150,height=150'); newWindow.moveTo(550, 250); } </script> </body> </html>
আউটপুট

নতুন উইন্ডো তৈরি করুন এবং সরান বাটনে ক্লিক করলে একটি নতুন উইন্ডো তৈরি হবে এবং moveTo() মেথড ব্যবহার করে তা নির্দিষ্ট স্থানাঙ্কে সরানো হবে।
