@@ -926,7 +926,7 @@ if ( "value" in document.createElement("meter") &&
926
926
}
927
927
928
928
var testVal = function ( valueObj ) {
929
- expect ( 8 ) ;
929
+ expect ( 9 ) ;
930
930
931
931
jQuery ( "#text1" ) . val ( valueObj ( "test" ) ) ;
932
932
equal ( document . getElementById ( "text1" ) . value , "test" , "Check for modified (via val(String)) value of input element" ) ;
@@ -941,7 +941,9 @@ var testVal = function( valueObj ) {
941
941
equal ( document . getElementById ( "text1" ) . value , "" , "Check for modified (via val(null)) value of input element" ) ;
942
942
943
943
var j ,
944
- $select1 = jQuery ( "#select1" ) ;
944
+ select = jQuery ( "<select multiple><option value='1'/><option value='2'/></select>" ) ;
945
+ $select1 = jQuery ( "#select1" ) ,
946
+
945
947
$select1 . val ( valueObj ( "3" ) ) ;
946
948
equal ( $select1 . val ( ) , "3" , "Check for modified (via val(String)) value of select element" ) ;
947
949
@@ -957,6 +959,9 @@ var testVal = function( valueObj ) {
957
959
j . val ( valueObj ( "asdf" ) ) ;
958
960
equal ( j . val ( ) , "asdf" , "Check node,textnode,comment with val()" ) ;
959
961
j . removeAttr ( "value" ) ;
962
+
963
+ select . val ( valueObj ( [ "1" , "2" ] ) ) ;
964
+ deepEqual ( select . val ( ) , [ "1" , "2" ] , "Should set array of values" ) ;
960
965
} ;
961
966
962
967
test ( "val(String/Number)" , function ( ) {
0 commit comments