make first letter capital in javascript
by Ramya[ Edit ] 2010-03-01 20:04:26
Make first letter capital in Javascript:
Use toUpperCase() to make first letter capital.
variable-name.charAt(0).toUpperCase + slice the first letter as string.slice(1)
For eg,
var string = "hscripts.com";
document.getElementById('div').value = string.charAt(0).toUpperCase()+string.slice(1);