jqxEditor

jQuery Editor: Popup Editor

Display jqxEditor in window.

A live JavaScript/jQuery example of jqxEditor, the jQWidgets Editor component, with its complete source code below. It is one of 14 jqxEditor demos for jQuery.

jqxEditor API used in this demo

Source code

To run it in your own page, load jqx.base.css, a theme and the library files below from npm (npm install jqwidgets-scripts) or the jsDelivr CDN, then add the markup and the script. jQuery is not required: jqxcore.js provides $. Getting started with jqxEditor shows the setup step by step.

The page loads jqx.base.css, a theme and these library files: jqxcore.js, jqxbuttons.js, jqxwindow.js, jqxscrollbar.js, jqxeditor.js, jqxlistbox.js, jqxdropdownbutton.js, jqxdropdownlist.js, jqxcheckbox.js.

It also loads helper scripts of this demo site, which are not part of the library: demos.js (getWidth() and other layout helpers).

script.js

$(document).ready(function () {
    // create button.
    $("#openButton").jqxButton();
    // create window.
    $('#window').jqxWindow({
        autoOpen: false, width: 500, position: 'top, left', height: 400, maxWidth: 800, resizable: false,
        initContent: function () {
            // create editor.
            $("#editor").jqxEditor({ tools: 'bold italic underline font size', width: '100%', height: '100%' });
        }
    });

    $("#openButton").click(function () {
        $('#window').jqxWindow('open');
    });
});

body.html

<button id="openButton">Open Editor</button>
<div id="window">
    <div>
        jqxEditor
    </div>
    <div>
        <div id="editor"></div>
    </div>
</div>

Learn more

More jQuery Editor demos