Skip to main content

Store arbitrary data associated with the specified element. Returns the value that was set.

$("div").data("myName", 'addy');
$("div").data("myName") === 'addy';

/* Here are two ways to remove all of the information bound to an element*/
$("div").removeData();
$("div").remove();