javascript - How to remove/hide select options from select-list -


i've got select list this:

<select id="selectlist" name="selectproduct" >     <option value=""> --- select product  --- </option>     <option value="1">product 1</option>     <option value="2">product 2</option>     <option value="3">product 3</option>     <option value="4">product 4</option> </select> 

unfortunately can't edit it. there method let me hide "product 4" option default? i'm trying css, doesn't work ie.

to hide it, wrap span tag.

$( "#selectlist option[value=4]" ).wrap( "<span>" ); 

to show it, unwrap span tag if has one.

if ( $( "#selectlist option[value=4]" ).parent().is( "span" ) ){     $( "#selectlist option[value=4]" ).unwrap(); } 

Comments