Make sure that hide or show don't fail when operating on non-Element nodes. Fixes #6135.

This commit is contained in:
John Resig 2011-04-17 11:07:42 -07:00
parent 728a70c036
commit 21c0be8496
2 changed files with 27 additions and 15 deletions

View file

@ -88,6 +88,10 @@ test("show()", function() {
var elem = jQuery(selector, "#show-tests").show();
equals( elem.css("display"), expected, "Show using correct display type for " + selector );
});
// Make sure that showing or hiding a text node doesn't cause an error
jQuery("<div>test</div> text <span>test</span>").show().remove();
jQuery("<div>test</div> text <span>test</span>").hide().remove();
});
test("show(Number) - other displays", function() {