Ex No: 5(a) CONVERT TEXT TO UPPERRCASE USING JAVASCRIPT
Aim: To write a JavaScript code to convert the entered string to uppercase and display the result.
Algorithm
Step1: Create a folder “Ex5a” to place the HTML files.
Step2: Create HTML file “index.html”.
Step3: Add JavaScript code to get the value of text input and use javascript function to convert it to upper case.
Step4: Using JavaScript display the result in a label.
Source Code

index.html


<!DOCTYPE html>
<html>
 <head>
  <title>Case Change</title> 
 <style>
   header {
	text-align:center;
	height: 100px;
	background-color: BurlyWood ;
	padding: 10px;
	border-radius: 10px 10px 0px 0px;
   }
   footer {
	text-align:center;
	font-size: 12px;
	height: 50px;
	line-height: 50px;
	background-color: BurlyWood ;
	padding: 10px;
	border-radius: 10px;
   }
   article{
	width: auto;
	padding: 10px;
	margin:5px;
	overflow-x: auto;
   }
 </style>
 <script type="text/javascript">
 function txtUcase()
 {
   var txt = document.getElementById('txtname').value;
   ucase = txt.toUpperCase();
   document.getElementById('res').innerHTML = ucase;  
 }
 </script>
 </head>
 <body>  
  <header>
   <h1>Uppercase Change</h1>
  </header> 
  <hr>
  <table>
    <tr>
      <td>Enter Your Name:</td>
      <td><input type="text" id="txtname" name="txtname"></td>
    </tr>
    <tr>
      <td>Uppercase:</td>
      <td><label id="res"> </label></td>
    </tr>
    <tr>
      <td colspan="2"><input type="button" value="Convert" onclick="txtUcase()"></td>
    </tr>
  </table>
  <footer>
   Developed by K Anbarasan
  </footer>
 </body>
</html>



Result: Thus JavaScript code is written to convert the entered string to uppercase and display the result.