Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js capitalize first letter

// this will only capitalize the first word
var name = prompt("What is your name");
firstLetterUpper = name.slice(0,1).toUpperCase();

alert("Hello " + firstLetterUpper + name.slice(1, name.length).toLowerCase());
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #js #capitalize #letter
ADD COMMENT
Topic
Name
1+7 =