toUpperCase() method with the string
The first part converts the first letter to upper case, and then appends the rest of the string.
If you want to capitalize the first letter of every word in a string, you can use
split() to split the string into words and then
join() the string back together as shown below.
For example, the below
<div> has the
capitalize class, with ‘captain picard’ as its inner text. CSS can convert all words in a string to uppercase.