Conditional text change for div class

I have a list of grades on web page with identical span class. I Would need to append the current numeric grade and add a alphabet grade after the number. Current information is a text field and i would first need to parse the first 3 characters to identify the number. Then i would need to create a 5 level condition to give correct alphabet based on the number (example 0-40 = D, 40-60 = C, 60-80= B and 80-100 = A). Im newbie and just cant make it to work.

Grades list

I am able to update update the text, but when trying to parse and create conditions just was not able to make it work.

var elements = document.querySelectorAll('.score_value');
for ( var i=elements.length; i--; ) {
    elements[i].textContent += "something else";
}

all the help would be appriciated