This plugin provides a simple way to spell characters of a string and present it to the user. It supports various characters and symbols.
-
Include jQuery:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
-
Include plugin's code:
<script src="dist/spell-me.min.js"></script>
-
Call the plugin:
$("#code").spellMe({
className: "spellify",//multiple classes can be added to the table e.g. "table table-reponsive"
target: "#result",//id or class e.g. ".myClass"
getTabulatedResult: true // appends a table to the specified target
});
Call it on the element which contains the code and that's it. If you have your own way of representing the spellified code. Just set the getTabulatedResult option to false and use the returnWords method, it will return an array of the spellified code.
var spellifiedCode = $("#code").spellMe({
getTabulatedResult: false
}).returnWords();
//returns ["Alfa", "Romeo", "Tango"]
Available options:
className: "anyClass" ( Use this option to add a class to the table created.)
target: "target-ID/CLASS" (Specify the ID/CLASS of the element to which the result should be appended to.)
getTabulatedResult: true (true by default, returns a HTML table appended to the target
, if set to false it will give an array of the spellified characters)
Click here to see the demo.
Check CONTRIBUTING.md for more information.
MIT License © Sahil Prajapati
Characters source from Wiki