HTML DOM removeAttribute() পদ্ধতি একটি HTML নথিতে নির্দিষ্ট উপাদান থেকে এর প্যারামিটারে নির্দিষ্ট করা বৈশিষ্ট্যকে সরিয়ে দেয়।
সিনট্যাক্স
নিম্নলিখিত সিনট্যাক্স −
node.removeAttribute(attributeName);
উদাহরণ
আমরা removeAttribute() পদ্ধতির একটি উদাহরণ দেখি -
<!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 removeAttribute() 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() {
document.querySelector("p").removeAttribute("style");
}
</script>
</body>
</html> আউটপুট
এটি নিম্নলিখিত আউটপুট তৈরি করবে -

“অ্যাট্রিবিউট সরান-এ ক্লিক করুন
এলিমেন্ট
থেকে স্টাইল অ্যাট্রিবিউট অপসারণের জন্য ” বোতাম
