In this article we will learn how to convert upper case into lower case on button click in Knockout.js.
In my previous article about Knockout.js, I explained Computed Observables in Knockout.js.
This article explains how to convert words into lowercase on the click of a button.
Step 1
Start Visual Studio.
Step 2
For executing application in knockout.js we need to add the knockout.js library to our website. To do that we will manage the NuGet Package. For this, right-click on the website and click on the NuGet Packages.
Step 3
In the NuGet packages we will search for Knockout.js and install Knockout.js library.
Step 4
After adding the library, now we will design the web form like the following:
Step 5
Now we need to add the knockout.js file to our application.
I have added the knockout-3.3.0.js file because without this we can't do the knockout.js operation.
We write the following code for designing the form:
In this I have taken three labels that indicate the first name, middle name, last name and I have also taken three textboxes for input from the user. Also, I will add a button for performing the operations.
Step 6
Now we will write the complete code for Knockout.js. By default I have taken the value Rahul kumar Sharma.
Complete Code
Now we will execute that code using the F5 key. After execution the following window appears on the screen.
If we click on the submit button then all words are converted into lowercase.
Summary
In this article I explained how to convert words into lowercase on the click of a button.
I hope this article will be helpful for beginners if they want to start working on knockout.js in Visual Studio 2013.
Diving into Knockout.JS