What is the functional difference between these three jQuery methods:
- detach()
- hide()
- remove()
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.
hide()sets the matched elements’ CSSdisplayproperty tonone.remove()removes the matched elements from the DOM completely.detach()is likeremove(), but keeps the stored data and events associated with the matched elements.To re-insert a detached element into the DOM, simply insert the returned
jQueryset fromdetach():