A numbered list by default uses decimals in jQuery Mobile. The framework uses CSS to add the numbering. JavaScript is used where CSS cannot be used. This recipe shows you how to add alphabet numbering to your list using JavaScript.
Copy the full code of this recipe from the code/06/custom-numbered-list
sources folder. This code can be launched using the URL http://localhost:8080/06/custom-numbered-list/main.html
.
In
main.html
, create an ordered and an unordered list as shown in the following code:<div data-role='content'> <ol data-role='listview' data-theme='e' data-inset='true'> <li>Soccer</li> <li>Basketball</li> <li>Hockey</li> <li>Tennis</li> </ol> <ul id='alphalist' data-role='listview' data-theme='e' data-inset='true'> <li>Soccer</li> <li>Basketball</li> <li>Hockey</li> <li>...