I got this code from the web but it doesn't seem to work.. Is the syntax all right? It is from http://verlager.com/super-dev.php which contains names that should be capitalized. The problem is that the strings are all uppcase, so I have to change them to lowercase and then capitalize the first and last name.
JS:
if ($temp > "") { $temp.addClass('capitalize'); // what should I use?
var $full = $temp.split(","); var $nick = $full[0]; $name = $nick.substr( 0, 16);
$("#I" + i).val($name + ", " + $full[1].substr(0, 1) + ". " + members.find(x => x.Name === $temp).Rating);
}
CSS:
.capitalize {text-transform:capitalize;} //$temp is all caps