Skip to content

Instantly share code, notes, and snippets.

@ibolmo
Forked from arian/Element.js
Created August 12, 2011 18:07
Show Gist options
  • Save ibolmo/1142603 to your computer and use it in GitHub Desktop.
Save ibolmo/1142603 to your computer and use it in GitHub Desktop.
select.get('value');
/*<ltIE9>*/
var testForm = document.createElement('form');
testForm.innerHTML = '<select><option>s</option></select>';\
if (testForm.firstChild.value != 's') Element.Properties.value = {
get: function(){
var option = this, tag = option.get('tag');
if (tag != 'select' && tag != 'option') return this.getProperty('value');
if (tag == 'select') if (!(option = option.getSelected()[0])) return '';
var attr = option.getAttributeNode('value');
return (attr && attr.specified) ? option.value : option.get('text');
}
};
/*</ltIE9>*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment