* \r
*/\r
X.Dom.Node.prototype.attr = function( nameOrObj /* v */ ){\r
- var attrs = this._attrs, newAttrs, f, p, elm;\r
+ var attrs = this._attrs, newAttrs, f, p, elm, v;\r
\r
if( this._xnodeType !== 1 ) return this;\r
\r
};\r
return this;\r
} else\r
- if( nameOrObj === 'value' && X.Dom.Attr.HAS_VALUE[ this._tag.toUpperCase() ] ){\r
- if( this._newAttrs && this._newAttrs.value ) return this._newAttrs.value;\r
- if( elm = X.Dom.DOM_IE4 ? this._rawNode || this._ie4getRawNode() : this._rawNode ){\r
- attrs.value = elm.value;\r
- };\r
- return attrs.value;\r
- } else\r
- if( typeof nameOrObj === 'string' && attrs ){\r
+ if( typeof nameOrObj === 'string' ){\r
// getter\r
switch( nameOrObj ){\r
case 'id' :\r
case 'style' :\r
case 'cssText' :\r
return this.cssText();\r
+ case 'value' :\r
+ case 'selectedIndex' :\r
+ if( X.Dom.Attr.HAS_VALUE[ this._tag ] ){\r
+ if( this._newAttrs && X.inObject( nameOrObj, this._newAttrs ) ) return this._newAttrs[ nameOrObj ];\r
+ if( elm = X.Dom.DOM_IE4 ? this._rawNode || this._ie4getRawNode() : this._rawNode ){\r
+ attrs[ nameOrObj ] = elm[ nameOrObj ]; // getAttribute( nameOrObj )?\r
+ };\r
+ return attrs[ nameOrObj ];\r
+ };\r
+ break;\r
};\r
- return attrs[ X.Dom.Attr.renameForTag[ nameOrObj ] || nameOrObj ];\r
+ return attrs && attrs[ X.Dom.Attr.renameForTag[ nameOrObj ] || nameOrObj ];\r
};\r
};\r
X.Dom.Node.prototype._setAttr = function( attrs, newAttrs, name, v ){\r