removeAttr()

Removes the specified HTML attribute from an element or from each element in a set of elements. To add or change an attribute, use attr() (see attr()).

removeAttr(attributeName​)

attributeName

String; the name of the attribute.

Examples

This script looks up an email field in a form (which is an <input> with the ID #email1) and removes its readonly attribute.

query("#email1").removeAttr('readonly');
 
  • Last Topic Update: 19, February, 2018 12:18 PM
  • Last Published: 23, May, 2019 01:55 PM