6 ], function( jQuery, access, support ) {
10 var rfocusable = /^(?:input|select|textarea|button)$/i,
11 rclickable = /^(?:a|area)$/i;
14 prop: function( name, value ) {
15 return access( this, jQuery.prop, name, value, arguments.length > 1 );
18 removeProp: function( name ) {
19 return this.each( function() {
20 delete this[ jQuery.propFix[ name ] || name ];
26 prop: function( elem, name, value ) {
28 nType = elem.nodeType;
30 // Don't get/set properties on text, comment and attribute nodes
31 if ( nType === 3 || nType === 8 || nType === 2 ) {
35 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
37 // Fix name and attach hooks
38 name = jQuery.propFix[ name ] || name;
39 hooks = jQuery.propHooks[ name ];
42 if ( value !== undefined ) {
43 if ( hooks && "set" in hooks &&
44 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
48 return ( elem[ name ] = value );
51 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
60 get: function( elem ) {
62 // Support: IE <=9 - 11 only
63 // elem.tabIndex doesn't always return the
64 // correct value when it hasn't been explicitly set
65 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
66 // Use proper attribute retrieval(#12072)
67 var tabindex = jQuery.find.attr( elem, "tabindex" );
70 return parseInt( tabindex, 10 );
74 rfocusable.test( elem.nodeName ) ||
75 rclickable.test( elem.nodeName ) &&
92 // Support: IE <=11 only
93 // Accessing the selectedIndex property
94 // forces the browser to respect setting selected
96 // The getter ensures a default option is selected
97 // when in an optgroup
98 // eslint rule "no-unused-expressions" is disabled for this code
99 // since it considers such accessions noop
100 if ( !support.optSelected ) {
101 jQuery.propHooks.selected = {
102 get: function( elem ) {
104 /* eslint no-unused-expressions: "off" */
106 var parent = elem.parentNode;
107 if ( parent && parent.parentNode ) {
108 parent.parentNode.selectedIndex;
112 set: function( elem ) {
114 /* eslint no-unused-expressions: "off" */
116 var parent = elem.parentNode;
118 parent.selectedIndex;
120 if ( parent.parentNode ) {
121 parent.parentNode.selectedIndex;
140 jQuery.propFix[ this.toLowerCase() ] = this;