赞
踩
1
2
3
4
5
6
7
8
9
10
11
12
13
|
//2509行
if
( !getSetInput || !getSetAttribute ) {
jQuery.attrHooks.value = {
get:
function
( elem, name ) {
var
ret = elem.getAttributeNode( name );
return
jQuery.nodeName( elem,
"input"
) ?
// Ignore the value *property* by using defaultValue
elem.defaultValue :
ret && ret.specified ? ret.value : undefined;
},
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
attrHooks: {
type: {
set:
function
( elem, value ) {
if
( !jQuery.support.radioValue && value ===
"radio"
&& jQuery.nodeName(elem,
"input"
) ) {
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to default in case type is set after value during creation
var
val = elem.value;
elem.setAttribute(
"type"
, value );
if
( val ) {
elem.value = val;
}
return
value;
}
}
}
},
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
//2361行
attrHooks: {
type: {
set:
function
( elem, value ) {
// We can't allow the type property to be changed (since it causes problems in IE)
if
( rtype.test( elem.nodeName ) && elem.parentNode ) {
jQuery.error(
"type property can't be changed"
);
}
else
if
( !jQuery.support.radioValue && value ===
"radio"
&& jQuery.nodeName(elem,
"input"
) ) {
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to it's default in case type is set after value
// This is for element creation
var
val = elem.value;
elem.setAttribute(
"type"
, value );
if
( val ) {
elem.value = val;
}
return
value;
}
}
},
// Use the value property for back compat
// Use the nodeHook for button elements in IE6/7 (#1954)
value: {
get:
function
( elem, name ) {
if
( nodeHook && jQuery.nodeName( elem,
"button"
) ) {
return
nodeHook.get( elem, name );
}
return
name
in
elem ?
elem.value :
null
;
},
set:
function
( elem, value, name ) {
if
( nodeHook && jQuery.nodeName( elem,
"button"
) ) {
return
nodeHook.set( elem, value, name );
}
// Does not return so that setAttribute is also used
elem.value = value;
}
}
},
|
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。