Correction after 7f973d9f12efa5816ae671e66bbd5bc3b9679cdc. jQuery.contains does not accept jQuery objects.