]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/ex-mode/node_modules/space-pen/node_modules/jquery/src/attributes/prop.js
d4ee8b6b9c6000c4155034ca4aa3d8f4eed15cda
5 ], function( jQuery
, access
, support
) {
7 var rfocusable
= /^(?:input|select|textarea|button)$/i;
10 prop: function( name
, value
) {
11 return access( this, jQuery
.prop
, name
, value
, arguments
.length
> 1 );
14 removeProp: function( name
) {
15 return this.each(function() {
16 delete this[ jQuery
.propFix
[ name
] || name
];
27 prop: function( elem
, name
, value
) {
28 var ret
, hooks
, notxml
,
29 nType
= elem
.nodeType
;
31 // Don't get/set properties on text, comment and attribute nodes
32 if ( !elem
|| nType
=== 3 || nType
=== 8 || nType
=== 2 ) {
36 notxml
= nType
!== 1 || !jQuery
.isXMLDoc( elem
);
39 // Fix name and attach hooks
40 name
= jQuery
.propFix
[ name
] || name
;
41 hooks
= jQuery
.propHooks
[ name
];
44 if ( value
!== undefined ) {
45 return hooks
&& "set" in hooks
&& (ret
= hooks
.set( elem
, value
, name
)) !== undefined ?
47 ( elem
[ name
] = value
);
50 return hooks
&& "get" in hooks
&& (ret
= hooks
.get( elem
, name
)) !== null ?
58 get: function( elem
) {
59 return elem
.hasAttribute( "tabindex" ) || rfocusable
.test( elem
.nodeName
) || elem
.href
?
67 if ( !support
.optSelected
) {
68 jQuery
.propHooks
.selected
= {
69 get: function( elem
) {
70 var parent
= elem
.parentNode
;
71 if ( parent
&& parent
.parentNode
) {
72 parent
.parentNode
.selectedIndex
;
91 jQuery
.propFix
[ this.toLowerCase() ] = this;