var values = document.querySelectorAll("#values li");

for (var i = 0, len =values.length; i < len; i++) {
  var value = values[i];
  var text = value.innerHTML.trim(); // assuming theres just simple text in there
  value.classList.add("size-" + text.length); // use the shim on this page for ie9 https://developer.mozilla.org/en-US/docs/Web/API/element.classList
}

no jquery