javascript - Differences between detach(), hide() and remove() - jQuery -


what functional difference between these 3 jquery methods:

  • detach()
  • hide()
  • remove()

hide() sets matched elements' css display property none.

remove() removes matched elements dom completely.

detach() remove(), keeps stored data , events associated matched elements.

to re-insert detached element dom, insert returned jquery set detach():

var span = $('span').detach();  ...  span.appendto('body'); 

Comments

Popular posts from this blog

forms - Secure PHP File Upload Script -

PHP: Exploding array elements -

reflection - How to use FxCop CustomDictionary.xml from the project localization? -