6 ], function( jQuery, access, support ) {
8 var rfocusable = /^(?:input|select|textarea|button)$/i,
9 rclickable = /^(?:a|area)$/i;
12 prop: function( name, value ) {
13 return access( this, jQuery.prop, name, value, arguments.length > 1 );
16 removeProp: function( name ) {
17 return this.each( function() {
18 delete this[ jQuery.propFix[ name ] || name ];
24 prop: function( elem, name, value ) {
26 nType = elem.nodeType;
28 // Don't get/set properties on text, comment and attribute nodes
29 if ( nType === 3 || nType === 8 || nType === 2 ) {
33 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
35 // Fix name and attach hooks
36 name = jQuery.propFix[ name ] || name;
37 hooks = jQuery.propHooks[ name ];
40 if ( value !== undefined ) {
41 if ( hooks && "set" in hooks &&
42 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
46 return ( elem[ name ] = value );
49 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
58 get: function( elem ) {
60 // elem.tabIndex doesn't always return the
61 // correct value when it hasn't been explicitly set
62 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
63 // Use proper attribute retrieval(#12072)
64 var tabindex = jQuery.find.attr( elem, "tabindex" );
67 parseInt( tabindex, 10 ) :
68 rfocusable.test( elem.nodeName ) ||
69 rclickable.test( elem.nodeName ) && elem.href ?
82 // Support: IE <=11 only
83 // Accessing the selectedIndex property
84 // forces the browser to respect setting selected
86 // The getter ensures a default option is selected
87 // when in an optgroup
88 if ( !support.optSelected ) {
89 jQuery.propHooks.selected = {
90 get: function( elem ) {
91 var parent = elem.parentNode;
92 if ( parent && parent.parentNode ) {
93 parent.parentNode.selectedIndex;
97 set: function( elem ) {
98 var parent = elem.parentNode;
100 parent.selectedIndex;
102 if ( parent.parentNode ) {
103 parent.parentNode.selectedIndex;
122 jQuery.propFix[ this.toLowerCase() ] = this;