Edit in JSFiddle

function reverselist(list) {

        var totalItems = $(list).children().length;
        var start = $(list).attr('start');
        var thisitem;

        for(i=0; i < totalItems; i++) {
                thisItem = $(list).children();
                if (start !== "" && start !== undefined) { 
                        thisItem.eq(i).attr('value', start - i);
                } else {
                        thisItem.eq(i).attr('value', totalItems - i);
                }
        }
}
reverselist('ol[reversed=""]');

              
<ol reversed>

        <li>List Item 01</li>
        <li>List Item 02</li>
        <li>List Item 03</li>
        <li>List Item 04</li>
        <li>List Item 05</li>
        <li>List Item 06</li>
        <li>List Item 07</li>

</ol>