Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

jQuery Misc removeData() Method

❮ jQuery Misc Methods

Example

Remove previously attached data from a <div> element:

$("#btn2").click(function(){
  $("div").removeData("greeting");
  alert("Greeting is: " + $("div").data("greeting"));
});
Try it Yourself »

Definition and Usage

The removeData() method removes data previously set with the data() method.


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

❮ jQuery Misc Methods