jQuery has clean and cleanData methods. What is the purpose of jQuery clean and cleanData methods?
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().