In: Computer Science
Statement to check if inital letter will be a capital : string.charAt(0).toUpperCase()
JS Code that converts the inputted string's initial letter to capital :
<!DOCTYPE html> 
<html> 
        <head> 
                <title></title> 
        </head> 
                
        <body style = "text-align:left;"> 
        
                <h1 style = "color:black;" > 
                        Capital Initializer 
                </h1> 
                        
                <input id = "input" type="text" name="input"/> 
                <button onclick="Capital_Changer()"> 
                        Click to capitalize 
                </button> 
                <h3 id = "div" style="color: red"> 
                </h3> 
                        
                <script> 
                
                function Capital_Changer() { //Declaring function capital_changer
                var inp = document.getElementById("input");  //input variable
                var a = document.getElementById("div"); //returns value having id attribute
                var str = inp.value; 
                a.innerHTML = str.charAt(0).toUpperCase() +  //converting first letter to uppercase
                str.slice(1); 
                } 
                </script> 
        </body> 
</html>                                   
Code picture:

Output:

Summary : JS program that guarentees that the inputted string will start with capital letter. and I have also added the required statement at the beginning of the solution that guarentees the initial of a string to be a capital letter. This is all required by you in the question.
P.S. Hope you are satisfied with the provided solution, please give a thumbs up, Good Day !