valHooks: {
option: {
get: function( elem ) {
- // Use proper attribute retrieval(#6932, #12072)
var val = jQuery.find.attr( elem, "value" );
return val != null ?
val :
- elem.text;
+ jQuery.text( elem );
}
},
select: {
area = map.html("<area shape='rect' coords='0,0,0,0' href='#' alt='a' />").find("area");
equal( area.attr("coords"), "0,0,0,0", "did not retrieve coords correctly" );
});
+
+test( "should not throw at $(option).val() (#14686)", 1, function() {
+ try {
+ jQuery( "<option/>" ).val();
+ ok( true );
+ } catch ( _ ) {
+ ok( false );
+ }
+});