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
Post a Comment