diff --git a/CHANGELOG b/CHANGELOG index 4514274..5e510de 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Ensure Element.hide and Element.show return an element, even if you pass an element ID. (Andrew Dupont) + * Fix an issue where Element#getStyle('height') returns null if the height is set to "auto." (kangax, jddalton) * Add unit tests for Element#descendantOf. (jddalton) diff --git a/src/dom.js b/src/dom.js index df0162b..f52bc71 100644 --- a/src/dom.js +++ b/src/dom.js @@ -74,12 +74,14 @@ Element.Methods = { }, hide: function(element) { - $(element).style.display = 'none'; + element = $(element); + element.style.display = 'none'; return element; }, show: function(element) { - $(element).style.display = ''; + element = $(element); + element.style.display = ''; return element; },