Cómo ordenar los LI en función de su ID
Probar un montón de soluciones sin resultados viables. Tengo un código que toma el valor del lapso y crea una ID para el LI. Luego quiero ordenar estos DESCENDIENTES de LI en función de la identificación del LI. ¿Ayuda? ¡Gracias!
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<ul id="dumb">
<li>cello<span>2987</span></li>
<li>zello<span>1723</span></li>
<li>aello<span>3476</span></li>
</ul>
<script type='text/javascript' src='JQUERY INCLUDE'></script>
<script type="text/javascript">
$(document).ready(function() {
$('ul li span').each(function(){
var pubValue = $(this).html();
$(this).parent().attr('id', pubValue);
});
});
</script>
</body>
</html>