$(function() {
$(‘#IBE1_IBE_NurFlug1_ddl_Abflughafen > option[value*=”TR”]’).attr(“style”, “display: none;”);
does not hide options in a select. Also .hide does not work. What’s wrong here? In Firefox it’s ok.
Thx a lot
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Firefox for some reason is the only browser I’ve used that let’s you modify
<option>elements via CSS.In truth, you cannot hide
<option>elements – they must be removed from the<select>‘soptions[]array.Edit:
Example:
You can see the example live here.
The idea is to pull ALL
<option>children from the<select>. This is necessary for proper indexing (so we remove the right thing).We then iterate through the
<option>s and run your selector against them. If it matches, we remove that option based on the index passed byeach.The
diffis counting the removals so we do not remove the wrong<option>as theoptions[]array decreases in size from previous deletions.