var value, option,
options = elem.options,
index = elem.selectedIndex,
- one = elem.type === "select-one",
+ one = elem.type === "select-one" || index < 0,
values = one ? null : [],
max = one ? index + 1 : options.length,
i = index < 0 ?
var select6 = jQuery( "<select multiple id=\"select6\"><option value=\"1\">A</option><option value=\"2\">B</option></select>" ).appendTo( "#form" );
jQuery( select6 ).val( "nothing" );
- assert.deepEqual( jQuery( select6 ).val(), [], "Non-matching set (single value) on select-multiple" );
+ assert.equal( jQuery( select6 ).val(), null, "Non-matching set (single value) on select-multiple" );
jQuery( select6 ).val( [ "nothing1", "nothing2" ] );
- assert.deepEqual( jQuery( select6 ).val(), [], "Non-matching set (array of values) on select-multiple" );
+ assert.equal( jQuery( select6 ).val(), null, "Non-matching set (array of values) on select-multiple" );
select6.remove();
} );