jQuery Data - jQuery.removeData() Method

Example

Remove previously added data from the 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 using the data() method.

Note:This is a low-level method; use .removeData() more convenient.

Syntax

$().removeData(name)
Parameters Description
name

Optional. Specifies the name of the data to be removed.

If no name is specified, this method will remove all stored data from the selected element.