jQuery Misc removeData() metoda
Příklad
Odeberte dříve připojená data z prvku <div>:
$("#btn2").click(function(){
$("div").removeData("greeting");
alert("Greeting is: " + $("div").data("greeting"));
});
Definice a použití
Metoda removeData() odstraní data dříve nastavená pomocí metody data() .
Syntax
$(selector).removeData(name)
Parameter | Description |
---|---|
name | Optional. Specifies the name of data to remove. If no name is specified, this method will remove all stored data from the selected elements |