The plugin allows user to format text online. The result text can be directly sent to whatsapp API which will be consistent against format.
- Include jQuery
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
- Include plugin's code:
<script src="src/js/whatsapp-editor.js"></script>
- Use the plugin
$("#element").whatsappEditor();
OR $("#element").whatsappEditor(OPTIONS);
Use
var editor=$("#element").whatsappEditor(); // Initialize editor
var content=editor.getFormattedContent(); // Formatted WhatsApp content
- bold: Allows user to select text and mark them as Bold
- italic: Allows user to select text and mark them as Italic
- Strikethrough: Allows user to select text and mark them as
Strikethrough - Monospace: Allows user to select text and mark them as
Monospace
- Content: Allows developer to specify default text for converting to whatsapp type text.
For more information see index.html file.