Converting String to Upper Case in JavaScript

By | August 2, 2011

Hi,

For converting a string to upper case in javascript, use the following code.


<html>
<head>
<title>Convert String</title>
<script type="text/javascript" language="javascript">
<!-- //
onload = function(){
    var str = new String("coderzheaven");
    var toUpperCase = str.toUpperCase();
    document.write(toUpperCase);
}
// -->
</script>
</head>
<body>

</body>
</html>

It will give you ‘CODERZHEAVEN’

🙂

One thought on “Converting String to Upper Case in JavaScript

Leave a Reply

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