diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 1f723fde3..0ba33c193 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -1136,6 +1136,13 @@ function test_jQuery_removeData() { $("span:eq(3)").text("" + jQuery.data(div, "test2")); } +function test_removeDataAll() { + var el = $("div"); + el.data("test1", "VALUE-1"); + el.data("test2", "VALUE-2"); + el.removeData(); +} + function test_dblclick() { $('#target').dblclick(function () { alert('Handler for .dblclick() called.'); diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 3641af850..5beb4e4af 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1581,6 +1581,10 @@ interface JQuery { * @param list An array of strings naming the pieces of data to delete. */ removeData(list: string[]): JQuery; + /** + * Remove all previously-stored piece of data. + */ + removeData(): JQuery; /** * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.