MCPcopy Index your code
hub / github.com/jquery/jquery / remove

Function remove

dist-module/jquery.module.js:5471–5490  ·  view source on GitHub ↗
( elem, selector, keepData )

Source from the content-addressed store, hash-verified

5469}
5470
5471function remove( elem, selector, keepData ) {
5472 var node,
5473 nodes = selector ? jQuery.filter( selector, elem ) : elem,
5474 i = 0;
5475
5476 for ( ; ( node = nodes[ i ] ) != null; i++ ) {
5477 if ( !keepData && node.nodeType === 1 ) {
5478 jQuery.cleanData( getAll( node ) );
5479 }
5480
5481 if ( node.parentNode ) {
5482 if ( keepData && isAttached( node ) ) {
5483 setGlobalEval( getAll( node, "script" ) );
5484 }
5485 node.parentNode.removeChild( node );
5486 }
5487 }
5488
5489 return elem;
5490}
5491
5492jQuery.extend( {
5493 htmlPrefilter: function( html ) {

Callers 1

jQueryFactoryFunction · 0.70

Calls 3

getAllFunction · 0.70
isAttachedFunction · 0.70
setGlobalEvalFunction · 0.70

Tested by

no test coverage detected