In this post, we will learn about how to capitalize the first letter of each word. Here is the simple example of how to do this using jquery. In this example first we need to add one js file for accessessing the css() function. Let's start coding.
First we need to add the below js file for accessing the css() function.
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
- <!DOCTYPE html>
- <html>
- <head>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
- <script>
- $(document).ready(function () {
- $("#test").keyup(function () {
- $('#test').css('textTransform', 'capitalize');
- });
- });
- </script>
- </head>
- <body>
- <h1>First Letter Capital</h1>
- <input type="text" id="test" />
- </body>
- </html>

Join the conversation! Your thoughts help the community grow.