element.removeAttribute(attributeName)
<style>
    .bg {
        background-color: yellowgreen;
    }
</style>
<p class="bg">Try removing the background color.</p>
<button type="button">Remove Background Color</button>
const elem = document.querySelector("p");
const button = document.querySelector("button");

button.addEventListener("click", () => { // Button click event
    /* When the button is clicked,
       the class attribute is removed from the p element. */
    elem.removeAttribute("class");
});
Rendered Output Click the "Remove Background Color" button!
<input type="text" value="Hello World!" disabled>
<button type="button">Enable<</button>
const input = document.querySelector("input");
const button = document.querySelector("button");

button.addEventListener("click", () => {
    input.removeAttribute("disabled");
});
Rendered Output First, observe the disabled text input field.
Then, click the 'Enable' button and check whether the text input field becomes enabled again.