MCPcopy Create free account
hub / github.com/components/jquery / remove

Function remove

jquery.js:5485–5504  ·  view source on GitHub ↗
( elem, selector, keepData )

Source from the content-addressed store, hash-verified

5483}
5484
5485function remove( elem, selector, keepData ) {
5486 var node,
5487 nodes = selector ? jQuery.filter( selector, elem ) : elem,
5488 i = 0;
5489
5490 for ( ; ( node = nodes[ i ] ) != null; i++ ) {
5491 if ( !keepData && node.nodeType === 1 ) {
5492 jQuery.cleanData( getAll( node ) );
5493 }
5494
5495 if ( node.parentNode ) {
5496 if ( keepData && isAttached( node ) ) {
5497 setGlobalEval( getAll( node, "script" ) );
5498 }
5499 node.parentNode.removeChild( node );
5500 }
5501 }
5502
5503 return elem;
5504}
5505
5506jQuery.extend( {
5507 htmlPrefilter: function( html ) {

Callers 1

jquery.jsFile · 0.70

Calls 3

getAllFunction · 0.70
isAttachedFunction · 0.70
setGlobalEvalFunction · 0.70

Tested by

no test coverage detected