javascript - It'is possible to create an alphabetic vertical sidebar in HTML/jQuery? -
i have "ul" list of names. create alphabetical vertical sidebar when click on 1 of letter, li names begin letter filtered. example : mobile, need web application. i didn't found plugins or code example. update: explanation : the list sorted. need alphabetic vertical sidebar used scroll list , down. you can achieve doing this: traverse list. if first character of list element different previous list element: add unique id list element. add link alphabetical index (pointing unique id). a simple code achieve this: $("ul li").each(function() { var current = $(this).text()[0]; if (current != previous) { $(this).attr("id", "first_letter_" + current); previous = current; $("#index").append("<a href='#first_letter_" + current + "'>" + current + "</a><br/>"); } }); and can see working on demo (or on jsfiddle ): ...