Convert UL to SELECT w/OPTGROUPs

前端 未结 3 1517
不知归路
不知归路 2021-02-10 15:47

I\'m trying to convert (with jQuery) a multi-level UL into a SELECT dropdown with the nested UL group being wrapped in OPTGROUPS

3条回答
  •  情深已故
    2021-02-10 15:58

        // #ShankarSangoli code changed a little
    
    var markUp = ["");
    
    $("#sitemap").replaceWith(markUp.join(''));
    $("#sitemap").change(function(){ window.location = $(this).val(); });
    

提交回复
热议问题