Strictly from a performance standpoint, what are the differences between remove(), hide() and detach()?

If I want to permanently make an element go away on the page, is remove() or hide() even marginally faster than the other?

Recommended Answers

All 2 Replies

is remove() or hide() even marginally faster than the other?

Theoretically hide should be faster. Run a test and find out.

I've been using hide() forever (when doing various things such as hitting 'Delete' when browsing your list of private messages and making it go away in the list AJAXy).

I was just wondering if anyone knew if there was some advantage to using remove() and decreasing the size of the DOM as compared to adding what amounts to a CSS display:none.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.