[Solved] JS algoríthm for styling li elements [closed]


First; it’s not much of a question as other pointed out.

But here is what you are looking for, using jquery:

$("li").each(function(){
    var text = $(this).html();
    var number = parseInt(text, 10);
    switch(number){
        case 5:
            $(this).css( "backgroundColor", "yellow" );
            break;
        case 6:
            $(this).css( "backgroundColor", "green" );
            break;            
    }    
}); 

Link to JSFiddle http://jsfiddle.net/JQ25Z/

solved JS algoríthm for styling li elements [closed]