Re: [jquery-dev] A fix for the broken "selected" code in attr()

2009-12-22 Thread John Resig
>  // Safari mis-reports the default selected property of a hidden > option >  // Accessing the parent's selectedIndex property fixes it >  if ( name == "selected" && elem.parentNode ) { >    elem.parentNode.selectedIndex; >  } > > I previously made two points: > 1) This code will not work of the

[jquery-dev] A fix for the broken "selected" code in attr()

2009-12-21 Thread Matt
The attr() method contains this spooky code: // Safari mis-reports the default selected property of a hidden option // Accessing the parent's selectedIndex property fixes it if ( name == "selected" && elem.parentNode ) { elem.parentNode.selectedIndex; } I previously made two points: 1