Metoda jQuery Różne removeData()
Przykład
Usuń wcześniej dołączone dane z elementu <div>:
$("#btn2").click(function(){
$("div").removeData("greeting");
alert("Greeting is: " + $("div").data("greeting"));
});
Definicja i użycie
Metoda removeData() usuwa dane wcześniej ustawione za pomocą metody data() .
Składnia
$(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 |