Metoda removeAttribute

Metoda removeAttribute heq një atribut të caktuar nga një tag.

Sintaksa

javascriptelement.removeAttribute(emri i atributit);

Shembull

Le të heqim atributin value për elementin:

html<input id="elem" value="abcde">
javascriptlet elem = document.querySelector('#elem');
elem.removeAttribute('value');

Kodi HTML do të duket kështu (atributi value do të zhduket):

html<input id="elem">

Shihni gjithashtu