jQuery | removeData() with Examples Last Updated : 01 Oct, 2024 Comments Improve Suggest changes Like Article Like Report The removeData() is an inbuilt method in jQuery that is used to remove those data which are previously set with the data() method.Syntax:$(selector).removeData(args); Here "selector" is the selected element whose previously set data gets removed. Parameter: It accepts an optional parameter "args" which specifies the name of the data to remove for the selected element. Return Value: It returns the selected element with removed data. Example: In the below code, the data get removed by removeData() method set by the data() method. HTML <html> <head> <script src="https://code.jquery.com/jquery-1.10.2.js"> </script> <script> // working of remove data method $(document).ready(function () { // click here to add data to div element $("#b1").click(function () { $("div").data("greeting", "Hello Everyone !"); alert("GeeksforGeeks says : " + $("div"). data("greeting")); }); // click here to remove data from div element $("#b2").click(function () { $("div").removeData("greeting"); alert("Greeting is: " + $("div"). data("greeting")); }); }); </script> <style> #b1, #b2 { padding: 10px; margin: 20px; background-color: green; } </style> </head> <body> <button id="b1">Click here to add data to div element</button> <br> <button id="b2">Click here to Remove data from div element</button> <div></div> </body> </html> Output: Comment More infoAdvertise with us Next Article jQuery | removeData() with Examples K kundankumarjha Follow Improve Article Tags : JavaScript Web Technologies JQuery jQuery-Misc Similar Reads jQuery | Remove Elements In jQuery, in order to remove element and content you can use anyone of the following two jQuery methods: Methods: remove() - It is used to remove the selected element (and its child elements). empty() - It is used to removes the child elements from the selected element. Example-1: Using the jQuery 1 min read jQuery callbacks.remove() Method The jQuery callbacks.remove() method is used to remove a single callback or a collection of callbacks from a callback list.Syntax: callbacks.remove( callbacks )Parameters: callbacks: This parameter specifies a function, or an array of functions, which are to be removed from the callback list.Return 2 min read jQuery detach() Method The detach() is an inbuilt method in jQuery that removes the selected elements from the DOM tree including all text and child nodes but it keeps the data and the events. Document Object Model (DOM) is a World Wide Web Consortium standard. This defines accessing elements in the DOM tree. Syntax: $(se 1 min read jQuery remove() Method The remove() method in JQuery is used to remove all the selected elements including all the text. This method also remove data and all the events of the selected elements. Syntax: $(selector).remove()Return Value: It will return all the data of the selected elements deleted. Example 1: Input: $("p") 2 min read How to remove table row from table using jQuery ? Removing a table row using jQuery involves selecting a specific row within an HTML table and deleting it dynamically. This can be done through various methods like .remove() or .detach(), allowing developers to manipulate the table structure efficiently without reloading the page.Here we have some c 3 min read Like