javascript remove attribute code example

Example 1: remove attribute jquery

$("button").click(() => {
  $("div").removeAttr("id"); // <div id='12' class='nice'></div> --> <div class='nice'></div>
});

Example 2: remove disabled attribute javascript

document.getElementById('my-input-id').disabled = false;

Example 3: remove attribute javascript

document.getElementsByTagName("H1")[0].removeAttribute("class");

Example 4: html how to remove attribute#

element.removeAttribute(attributename)

Example 5: remove attribute jquery

$('p').attr('style','');