Create <select> from list - indent child items?
I have a UL LI menu that I am turning into a select dropdown when you're viewing it on a mobile. I want to now indent child items e.g List item 1 -- Child item 1 ---- Child Child item 1 -- Child item 2 List item 2 Rather than listing in one single line. I'm happy to just add nbsp to keep things easy - or add classes and CSS if more suitable. The code I am currently using to generate the select is: $("<select />").appendTo("#primary-nav"); $("<option />", { "selected": "selected", "value" : "", "text" : "Go to..." }).appendTo("#primary-nav select"); $("#primary-nav a").each(function() { var el