jQuery has clean and cleanData methods. What is the purpose of jQuery clean and cleanData methods?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Both are internal, undocumented methods, so you should not use them or rely on their current behavior, because they might change or disappear in the future.
That said,
clean()sanitizes the markup in the document fragments that are created from the HTML strings passed to some functions (most notably to $() itself).cleanData()frees the data associated with elements when they disappear from the DOM, e.g. through remove(), empty(), or html().