Reno, NV    +1 (800)0 621-0871

Go back

Bugs and Fixes | Web Design

is(“:visible”) selector in jquery not working

  |  May 9, 2011

Just found out that in webkit, the is(“:visible”) selector in jquery will not work since browsers have different views on select options being visible. I think webkit and IE behave the same in the sense that it just doesn’t support that so trying to do:

$('#booking_destination_location_id option:selected').is(":visible")

will not work in webkit (will always return false). The best way to do this is to check the parent select tag if it is visible:

$('#booking_destination_location_id option:selected').parent().is(":visible") or just $('#booking_destination_location_id").is(":visible")