remove
UK[r??mu:v] US[r??muv]
vt.Remove; expel; take off, take off; migrate
vi. Migrate, emigrate; leave
n. Distance, gap; move
data
UK[?de?t?] US[?det?, ?d?t?, ?dɑt?]
n. Data, material; plural of datum; [computer] data, information; value extracted from scientific experiments
jquery removeData() method syntax
Function: removeData() method deletes the data previously set through the data() method.
Syntax: $(selector).removeData(name)
Parameters:
Parameter | Description |
name | Optional. Specifies the name of the data to be deleted. If no name is specified, this method will remove all stored data from the selected element. |
jquery removeData() method example
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#btn1").click(function(){ $("div").data("greeting", "Hello World"); alert("Greeting is: " + $("div").data("greeting")); }); $("#btn2").click(function(){ $("div").removeData("greeting"); alert("Greeting is: " + $("div").data("greeting")); }); }); </script> </head> <body> <button id="btn1">向 div 元素添加數(shù)據(jù)</button><br /> <button id="btn2">從 div 元素刪除數(shù)據(jù)</button> <div></div> </body> </html>
Click the "Run instance" button to view the online instance