JavaScript - Display Input Text into Lowercase

In this code snippet we will learn how to convert input text into lowercase using JavaScript function.

Convert Input Text into Lowercase Characters

JavaScript function:

<script type="text/javascript">
   function convertCase(text){
   	var strLCase= text.toLowerCase();
   	document.getElementById("dispText").innerHTML = strLCase;
   }
</script>

HTML Source Code with JavaScript:

<!--JavaScript-Display Input Text into Lowercase Characters.-->
<html>
   <head>
      <title>JavaScript-Display Input Text into Lowercase Characters.</title>
      <script type="text/javascript">
         function convertCase(text){
         	var strLCase= text.toLowerCase();
         	document.getElementById("dispText").innerHTML = strLCase;
         }
      </script>
   </head>
   <body style="text-align: center">
      <h1>JavaScript-Display Input Text into Lowercase Characters.</h1>
      <input type="text" id="inputText"/><br><br>
      <input type="button" value="Display in Lowercase" onClick='convertCase(inputText.value)'/>
      <!--Lowercase text will display here-->
      <div id="dispText" style="text-size: 200%"></div>
   </body>
</html>

Result:

display input text in lowercase javascript

JavaScript Examples »



Related Examples



All JavaScript Examples

Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.