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

HTML DOM removeAttributeNode() মেথড


HTML DOM removeAttributeNode() মেথড তার প্যারামিটারটিতে নির্দিষ্ট অ্যাট্রিবিউটটিকে HTML ডকুমেন্টে নির্দিষ্ট এলিমেন্ট থেকে সরিয়ে দেয় এবং সরানো অ্যাট্রিবিউটটি Attr Node অবজেক্ট হিসেবে রিটার্ন করে।

সিনট্যাক্স

নিচে সিনট্যাক্স দেওয়া হলো:

node.removeAttributeNode(attributeNode);

উদাহরণ

removeAttributeNode() মেথডের একটি উদাহরণ দেখি:

<!DOCTYPE html> <html> <head> <style>    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat;       height:100%;    }    .btn{       background:#0197F6;       border:none;       height:2rem;       border-radius:2px;       width:35%;       margin:2rem auto;       display:block;       color:#fff;       outline:none;       cursor:pointer;    } </style> </head> <body> <h1>DOM removeAttributeNode() method Demo</h1> <p style="color:#db133a;font-size:1.2rem;">Hi! I'm a para element in HTML with some random text</p> <button onclick="remove()" class="btn">Remove Attribute</button> <script>    function remove() {       var p=document.querySelector("p");       var pAtt=p.getAttributeNode("style");       p.removeAttributeNode(pAtt);    } </script> </body> </html>

আউটপুট

এটি নিচের আউটপুট তৈরি করবে:

HTML DOM removeAttributeNode() মেথড

Remove Attribute বাটনে ক্লিক করুন

এলিমেন্ট থেকে style অ্যাট্রিবিউট সরাতে।

HTML DOM removeAttributeNode() মেথড


  1. HTML DOM getElementById() মেথড

  2. HTML DOM getBoundingClientRect() মেথড

  3. HTML DOM hasAttributes() মেথড

  4. HTML DOM focus() মেথড