To convert a string (text) to lowercase one can make use of javaScript toLowercase() function.
Let's see an example:<html>
<head>
<title>Convert text to lower case!</title>
</head>
<body>
<input type="text" style="width:300px;padding:6px" id="text"
placeholder="Enter text to convert to lower case"/>
<br/><br/>
<input type="button" value="Convert" onClick="convertToLovercase();"/>
<br/><br/>
<input type="text" style="width:300px;padding:6px" id="result"
placeholder="Result"/>
<script type="text/javascript">
function convertToLovercase() {
var data = document.getElementById("text").value;
var lowerCase = data.toLowerCase();
document.getElementById("result").value = lowerCase;
}
</script>
</body>
</html>
More Posts related to JavaScript,
- Add Animated Scrolling to Html Page Title Script
- How to get query string in JavaScript HTML location.search
- How to get current URL Location using Javascript HTML
- How to detect Browser and Operating System Name and Version using JavaScript
- Submit html form on dropdown menu value selection or change using javascript
- How to Print from JavaScript HTML using window.print
- JavaScript : Get url protocol HTTP, HTTPS, FILE or FTP
- JavaScript : Get current page address
- How to send email from JavaScript HTML using mailto
- Send Extra Data with Ajax Get or Post Request
- Write javaScript code in Swedish using FikaScript
- Get Device Screen Width and Height using javaScript
- How to get UTC (GMT) using javascript
- Javascript convert text case from uppercase to lowercase
- Loading previous page using html button using JavaScript
- [javaScript] Convert text case to lowercase
- Detect if Cookies are enabled using JavaScript
More Posts:
- Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED - Android
- Create assets folder in Android Studio - Android-Studio
- Make Android TextView Clickable like Buttons - Android
- Add imports in eclipse shortcut key combinations - Eclipse
- SharePoint error cannot connect to the configuration database - SharePoint
- How to hide quick launch in SharePoint - SharePoint
- MySQL #6 - Error on delete of './my-database/db.opt' (Errcode: 13 - Permission denied) - MySQL
- 11 Weeks of Android Online Sessions-15-Jun-to-28-Aug-2020 - Android
- PHP header location function not called - PHP
- Compare two files in Notepad++ - NotepadPlusPlus
- AlertDialog with no buttons (just text message) - Android
- How to Save Eclipse console logs in external log file - Eclipse
- How to Enable spellcheck Notepad++ - NotepadPlusPlus
- Center align text in TextView Android Programming - Android
- ADT Installation Error: requires plug-in org.eclipse.wst.sse.ui - Android