Jan
16th

Convert String to Lowercase In Javascript

Files under Javascript

Now you can learn how to convert to lower case letters by using toLowerCase() functions in JavaScript. So, in order to convert a string to lower case, then you need to call the toLowerCase() method on the string.

tolowercase

The toLowerCase() method will return a lower case string into a new text field called “output”.

Sample Code of Converting String to Lowercase

Place this code inside the head section.

<script>
function toLowercase() {
document.form.output.value = document.form.input.value.toLowerCase();

}
</script>

Place this code inside the body section.

<form name=“form”>
<input name=“input” type=“text” value=“im CodeBasic.net” size=“20″><br>
<input type=“button” value=“To Lowercase” onClick=”toLowercase();”><br>

<input name=“output” type=“text” value=”" size=“20″>

</form>


Sorry, comments for this entry are closed at this time.