Fixed an issue with parentNode being accessed in attr() on disconnected DOM elements.
[jquery.git] / src / core.js
index 78f0cae..6c439a5 100644 (file)
@@ -961,7 +961,7 @@ jQuery.extend({
 
                        // Safari mis-reports the default selected property of a hidden option
                        // Accessing the parent's selectedIndex property fixes it
-                       if ( name == "selected" )
+                       if ( name == "selected" && elem.parentNode )
                                elem.parentNode.selectedIndex;
 
                        // If applicable, access the attribute via the DOM 0 way