Capitalized Case JavaScript code

 

Code adapted from stackoverflow.com ‘Convert string to title case with javascript‘ users Greg DeanBill the Lizard  licensed under cc by-sa 3.0