jQuery removeProp()Méthode
Exemple
Ajouter et supprimer l'attribut nommé "color" :
$("button").click(function(){
var $x = $("div");
$x.prop("color","FF0000");
$x.append("L'attribut color :" + $x.prop("color"));
$x.removeProp("color");
});
Essayez-le vous-même »
Définition et utilisation
La méthode removeProp() supprime prop()les propriétés définies par la méthode.
Remarque :N'utilisez pas cette méthode pour supprimer des attributs HTML tels que style, id ou checked. Utilisez plutôt la méthoderemoveAttr()à la place.
Syntaxe
$(selector).removeProp(property)
| Paramètre | Description |
|---|---|
| property | Spécifie le nom de la propriété à supprimer. |
Autres extensions
Méthodes HTML/CSS de jQuery