Método jQuery removeProp()

❮ Métodos jQuery HTML/CSS

Ejemplo

Agregue y elimine una propiedad llamada "color":

$("button").click(function(){
  var $x = $("div");
  $x.prop("color", "FF0000");
  $x.append("The color property: " + $x.prop("color"));
  $x.removeProp("color");
});

Definición y uso

El método removeProp() elimina una propiedad establecida por el método prop() .

Nota: No use este método para eliminar atributos HTML como estilo, id o marcado. Utilice el método removeAttr() en su lugar.


Sintaxis

$(selector).removeProp(property)

Parameter Description
property Specifies the name of the property to remove

❮ Métodos jQuery HTML/CSS