The toUpperCase () method is used to convert a string to uppercase.
Grammar
Stringobject.touppercase () return value
A new string in which all lowercase characters stringobject are converted to uppercase characters.
<script language= "JavaScript" >
<!--
var myString = new String (Prompt ("Please enter some various case text", ""));
document.write (Mystring.touppercase ());
Document.close ();
-->
</script>
Description
The toUpperCase function method in JavaScript has no effect on non-alphanumeric characters.
<title>convert String to Upper Case</title>
<script type= "text/web Effects" language= "JavaScript" >
<!--//
onload = function () {
var s = new String ("AAA Me");
var uppercase = S.touppercase ();
document.write (uppercase);
}
-->
</script>
<body>
</body>
Combine the above to see case conversion
Change your code to see if it fits your requirements.
<script language= "javascript"
function Loadsome () {
var Text1 = document.getElementById (' textfield1 ');
text1.focus ();
}
Function ToUpper () {
document.getelementbyid (' textfield2 '). Value = document.getElementById (' Textfield1 '). Value.touppercase ();
}
Function ToLower () {
document.getelementbyid ("Textfield4"). Value = document.getElementById (" Textfield3 "). Value.tolowercase ();
}
</script>
<title> case Conversion </title>
<body onload= "Loadsome ();"
<form action= "method=" ""
<p>
<input type= "text" id= "Textfield1"
<input type= "button" name= "Submit" value= "small-large" onclick= "ToUpper" ();
<input type= "text" id= "textfield2" value= ""
</p>
<p>
<input type= "text" id= "textfield3"
<input type= "button" Name= "Submit2" value= "big-small" onclick= " ToLower (); "
<input type= "text" id= "Textfield4" value= ""
</p>
</form>
</ Body>