Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

first letter capital in jquery

// Define function to capitalize the first letter of a string
function capitalizeFirstLetter(string){
  return string.charAt(0).toUpperCase() + string.slice(1);
}

// Calling function and display the result
var str1 = 'hi there!';
str1 = capitalizeFirstLetter(str1);
document.write(str1); // Print: Hi there!
Source by www.tutorialrepublic.com #
 
PREVIOUS NEXT
Tagged: #letter #capital #jquery
ADD COMMENT
Topic
Name
2+8 =