jquery - Hide specific value of option form -
i have code generated plugin arrays categories. need hide specifics categories form, "pro", "basico" , "todas las provincias.
<select id="category_name" class="taxonomies-filter-widget-input tax-with-childrens" name="category_name"> <option value="0">todas</option> <option class="level-0" value="pro">pro</option> <option class="level-0" value="basico">basico</option> <option class="level-0" value="todas-las-provincias">todas las provincias</option> <option class="level-0" value="alava">Álava</option> <option class="level-0" value="albacete">albacete</option> <option class="level-0" value="alicante">alicante</option> <option class="level-0" value="almeria">almería</option> <option class="level-0" value="avila">Ávila</option> <option class="level-0" value="teruel">teruel</option> </select>
$(function() { var tohidevalues = ["pro", "basico", "todas-las-provincias"]; $('#category_name option').each(function() { var $option = $(this); if ($.inarray($(this).val(), tohidevalues) !== -1) { $option.hide(); } }); });
Comments
Post a Comment