jQuery MiscellaneousremoveData()Method
Example
Remove previously attached data from the <div> element:
$("#btn2").click(function(){
$("div").removeData("greeting");
alert("Greeting is: " + $("div").data("greeting"));
});
$("div").removeData("greeting");
alert("Greeting is: " + $("div").data("greeting"));
});
Try it yourself »
Definition and Usage
The removeData() method removes the data set previously through thedata()method.
Syntax
$(selector).removeData(name)
| Parameters | Description |
|---|---|
| name | Optional. Specifies the name of the data to remove. If no name is specified, the method will remove all stored data from the selected elements. |
Other Extensions
jQuery Miscellaneous Methods