},
remove: function( selector ) {
- if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
+ if ( !selector || jQuery.multiFilter( selector, [ this ] ).length ) {
// Prevent memory leaks
jQuery( "*", this ).add([this]).each(function(){
jQuery.event.remove(this);
});
test("remove()", function() {
- expect(6);
+ expect(7);
jQuery("#ap").children().remove();
ok( jQuery("#ap").text().length > 10, "Check text is not removed" );
equals( jQuery("#ap").children().length, 0, "Check remove" );
ok( jQuery("#ap").text().length > 10, "Check text is not removed" );
equals( jQuery("#ap").children().length, 1, "Check filtered remove" );
+ jQuery("#ap").children().remove("a, code");
+ equals( jQuery("#ap").children().length, 0, "Check multi-filtered remove" );
+
// using contents will get comments regular, text, and comment nodes
equals( jQuery("#nonnodes").contents().length, 3, "Check node,textnode,comment remove works" );
jQuery("#nonnodes").contents().remove();