HTML DOM Section অবজেক্ট একটি HTML ডকুমেন্টের <section> এলিমেন্টকে রিপ্রেজেন্ট করে।
Section অবজেক্ট তৈরি করা যাক:
সিনট্যাক্স
নিচে সিনট্যাক্স দেওয়া হলো:
document.createElement("SECTION");
উদাহরণ
HTML DOM Section অবজেক্টের উদাহরণ:
<!DOCTYPE html> <html> <head> <style> body{ text-align:center; background-color:#fff; color:#0197F6; } h1{ color:#23CE6B; } .drop-down{ width:35%; border:2px solid #fff; font-weight:bold; padding:8px; } .btn{ background-color:#fff; border:1.5px dashed #0197F6; height:2rem; border-radius:2px; width:60%; margin:2rem auto; display:block; color:#0197F6; outline:none; cursor:pointer; } </style> </head> <body> <h1>DOM Section Object Demo</h1> <button onclick="createSection()" class="btn">Create a section object</button> <script> function createSection() { var sectionElement = document.createElement("SECTION"); sectionElement.innerHTML="<p> Hi! I'm a <section> element in HTML";</p> document.body.appendChild(sectionElement); } </script> </body> </html>
আউটপুট
এটি নিচের আউটপুট প্রডিউস করবে:

