5 of 119 menu

The removeAttr method

The removeAttr method removes attributes from elements.

Syntax

$(selector).removeAttr(attribute name);

Example

Let's remove the value attribute from the input:

<input type="text" value="!!!" id="test"> $('#test').removeAttr('value');

HTML the code will look like this:

<input type="text" id="test">

See also

  • method attr,
    which allows you to get and change attributes of elements
  • method prop,
    which allows you to work with the properties of elements
  • method removeProp,
    which allows you to delete properties of elements
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline