ADVERTISEMENT
ADVERTISEMENT

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 »


ADVERTISEMENT




ADVERTISEMENT



Comments and Discussions!

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.