Skip to content

Instantly share code, notes, and snippets.

@ibolmo
Forked from arian/Element.js
Created August 12, 2011 17:31
Show Gist options
  • Save ibolmo/1142517 to your computer and use it in GitHub Desktop.
Save ibolmo/1142517 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(){
if (this.get('tag') != 'select') return this.getProperty('value');
var selected = this.getSelected()[0];
if (!selected) return '';
var attr = selected.getAttributeNode('value');
return (attr.specified || attr.nodeValue) ? selected.value : selected.get('text');
}};
/*</ltIE9>*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment