Krajee

Basic Usage Example 1

Thankful to Krajee! BUY A COFFEEor to get more out of us.

Automatically convert a textarea element to Krajee Markdown Editor widget by setting its class as markdown. When using this approach to initialize without any javascript, you can set the plugin options as HTML5 data attributes to the textarea element. For example, you can set the bsVersion property via data-bs-version attribute.

Use the preview mode buttons in the bottom right corner of the editor to switch between the text editor and html preview modes. Note also that the height you set for the textarea element will be remembered (e.g. the rows="15" attribute setting will auto-configure the height of the editor region for the example).

The editor will automatically downgrade to a native HTML Textarea in case javascript/jquery is blocked on the browser. Notice also the bootstrap CSS class form-control is added to the textarea input element for this example. This will help handle the native textarea display style prior to plugin initialization.

Note, the demo example(s) uses:

  • this as the raw input source for the markdown textarea.

  • these assets loaded on the page in the order mentioned.

Tip

Not seeing the updated content on this page! Hard refresh your browser to clean cache for this page (e.g. SHIFT-F5 on Windows Chrome)


Example
Code
<textarea id="editor-b1" name="editor-b1" class="form-control markdown" rows="15" data-bs-version="4.1.1">
{RAW MARKDOWN DATA}
</textarea>

Note

You can now visit the Krajee Webtips Q & A forum for searching OR asking questions OR helping programmers with answers on these extensions and plugins. For asking a question click here. Select the appropriate question category (i.e. Krajee Plugins) and choose this current page plugin in the question related to field.

The comments and discussion section below are intended for generic discussions or feedback for this plugin. Developers may not be able to search or lookup here specific questions or tips on usage for this plugin.

 
visitors to Krajee Jquery Plugins since 22-May-2017