Hide options in a select list using jQuery

For what it’s worth, the second form (with the @) doesn’t exist in jQuery 1.3. The first isn’t working because you’re apparently expecting variable interpolation. Try this:

$("#edit-field-service-sub-cat-value option[value=" + title + "]").hide();

Note that this will probably break in various hideous ways if title contains jQuery selector metacharacters.

Leave a Comment