Easy jQuery Plugin For Text Case Changer - casechange

Easy jQuery Plugin For Text Case Changer - casechange
File Size: 4.71KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Case Change is a super tiny jQuery plugin for easily converting text between different cases: lower case, upper case, sentence case, title case and toggle case.

How to use it:

1. Include jQuery library and jQuery case change plugin in your html document

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="jquery.casechange.js"></script>

2. The sample html

<textarea id="text" rows="8" cols="50">
	this is an example to use the case change plugin. it tests several cases. it does the job by changing the options paramters.
</textarea>

<select id="toCaseOption">
<option>upperCase</option>
<option>lowerCase</option>
<option>sentenceCase</option>
<option>titleCase</option>
<option>toggleCase</option>
</select>

<button id="convert">Convert</button>

3. Call the plugin with options

<script>
$("#convert").on("click",function(){
var toCaseOption=$( "#toCaseOption option:selected" ).text();
$("#text").caseChange({
toCase:toCaseOption,
//toElement:$("#outputText"),
alwaysLowerCase:'none'
});
});
</script>

This awesome jQuery plugin is developed by harryngh. For more Advanced Usages, please check the demo page or visit the official website.