Select some text and click to buttons.
<!-- api buttons -->
<button onclick="saveSelection(event);">Save</button>
<button onclick="restoreSelection(event);">Restore</button>
<!-- element -->
<textarea id="entry"></textarea>
<!-- call -->
<script>
var app = RedactorX('#entry');
function saveSelection(e) {
e.preventDefault();
e.stopPropagation();
app.selection.save();
}
function restoreSelection(e) {
e.preventDefault();
e.stopPropagation();
app.selection.restore();
}
</script>