Change string to upper case with Javascript
In this article I will show you how to create a string object and then turn the entire string inside that object to uppercase letters using javascript. Our first step is to create a string object with this code.
var gadgets = new String(“This blog is about web development and internet!”);
then in order to turn the entire string above to uppercase and print it out on screen, all you need is this simple code.
var upperTxt = gadgets.toUpperCase();
document.write(upperTxt);
now browse to this article with your Firefox browser and you should see this.
The entire code is as follow, try it and see it in action.
<script type=”text/javascript”>
var gadgets = new String(“This blog is about web development and internet!”);
var upperTxt = gadgets.toUpperCase();
document.write(upperTxt);
</script>
This post will show you how to create a button which will call the javascript function when someone clicking on it – full code provided!
Read More Return the length of a string with javascript programThis tutorial will show you how to return the length of a string with javascript program – source code provided
Read More How to use ‘this’ in javascriptTutorial showing you how to use ‘this’ in javascript
Read More How to create a website redirect link with javascriptSample javascript code for creating a redirect link for your website.
Read More How to access the name property of a javascript functionExample showing you how to output the name of a function in javascript
Read More Changing javascript array elementExample with source code showing you how to change the array elements in javascript
Read More How to use the in javascript statement?Tutorial showing in javascript statement with code fully provided
Read More javascript for statementjavascript for statement in action with code and sample provided.
Read More javascript for injavascript for in statement showing the key and value pairs of an object. javascript for in statement showing the properties of window object also with free javascript code provided.
Read More How to create a new string object instance with javascript programExample showing you how to create a new instance of the string object with javascript – code provided!
Read More Javascript replace method reviewVarious examples with sample codes showing you the Javascript replace method in action.
Read More Javascript prototype in actionIn this article you will learn how to use javascript prototype by creating a simple program which will show an alert box with ‘Hello World!’ text.
Read More Change javascript array elementsThis article will show you how to change the javascript array elements.
Read More