All demos ↓← All 93 demos

Read-Only Mode

Display content without allowing edits.

Hello world!

RichTextEditor screenshot

Example code

<p>
    <button class="ls-cta mb-4 mb-sm-0 mr-3" onclick="toggle_readOnly()">Toggle ReadOnly</button>
</p>

<div id="div_editor1">
    <p>Hello world!</p>
    <p><img src='/images/editor-image.png' alt='RichTextEditor screenshot' /></p>
</div>

<script>
    var editor1 = new RichTextEditor("#div_editor1");

    function toggle_readOnly() {
        if (editor1.getReadOnly())
            editor1.setReadOnly(false);
        else
            editor1.setReadOnly(true);
    }
</script>

Use this in your app

This demo runs the same editor you get for every framework. See how to add it to yours: