Change string to upper case with Javascript

Post on July 10th, 2011 @ 1:45 PM by |Posted in : javascript code and samples | Tagged in : , , | No Comment |Send Email

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>


continue on : How to call a javascript function when someone is clicking on a button of your website

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 program

This 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 javascript

Tutorial showing you how to use ‘this’ in javascript

Read More

How to create a website redirect link with javascript

Sample javascript code for creating a redirect link for your website.

Read More

How to access the name property of a javascript function

Example showing you how to output the name of a function in javascript

Read More

Changing javascript array element

Example 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 statement

javascript for statement in action with code and sample provided.

Read More

javascript for in

javascript 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 program

Example showing you how to create a new instance of the string object with javascript – code provided!

Read More

Javascript replace method review

Various examples with sample codes showing you the Javascript replace method in action.

Read More

Javascript prototype in action

In 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 elements

This article will show you how to change the javascript array elements.

Read More


Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>