Trying to hide some options tag with jquery doesn't work IE, Safari and Opera

后端 未结 2 1116
[愿得一人]
[愿得一人] 2021-01-17 02:56

I am trying to hide some tags with jquery but it doesn\'t seem to work.

  • I want to hide all options that have the rel

相关标签:
2条回答
  • 2021-01-17 03:28

    You can't hide or show options. What you must do is clone your select and delete option tags you don't want.

    EDIT : something like that http://jsfiddle.net/RnfqW/5/

    0 讨论(0)
  • 2021-01-17 03:43

    Check out this code and customize it. I hope it will be useful...

    $(function(){
        $.fn.extend({
            slidingSelect: function(options)
            {
                var select= $(this);
                var selector=select.selector;
               var selectedValue="";//=select.val();
    
                var divToggle=$("<div>"+selectedValue+"select Complaint<span style='float:right;'>&#x25BC;</span></div>").attr({id:select.attr("id")+"Toggle"}).click(function(){
                    $(selector).slideToggle();
                }).insertBefore(select);
    
                select.attr("size",6);  
                select.change(function(){
                    divToggle.html(select.val()+"<span style='float:right;'>&#x25BC;</span>");
                    $(selector).slideToggle();
                });
    
            }       
        });
        $("#complaint").hide().slidingSelect();
    
    });
    
    0 讨论(0)
提交回复
热议问题