I have some data(addresses) coming in from an API call. The problem I am facing is that the data is entered inconsistently. Some of the addresses are initial caps, and others are all caps. I tried using text-transform:capitalize;
but that doesn't seem to work on the text that is already all caps. Is there any way for me to resolve this using just CSS? Otherwise, what's the most efficient method to do this in Javascript?
p {
text-transform:capitalize;
}
<p>This Is an Address</p>
<p>THIS IS ANOTHER ADDRESS</p>
<p>all paragraphs should be initial caps<p>