Skip to content

Add instructions on how to add multiple editors to a single page. #627

@andrebruton

Description

@andrebruton

Please add instructions on how to add multiple editors to one page. Use code:

document.addEventListener('DOMContentLoaded', function() {
  const easyMDE1 = new EasyMDE({
    element: document.getElementById('editor1')
  });
  const easyMDE2 = new EasyMDE({
    element: document.getElementById('editor2')
  });
  const easyMDE3 = new EasyMDE({
    element: document.getElementById('editor3')
  });
});

Explanation:
document.addEventListener('DOMContentLoaded', function() { ... }); ensures that the JavaScript code runs only after the entire HTML document has been loaded and parsed.
new EasyMDE({ element: ... }); creates a new EasyMDE instance. The element option specifies which textarea element to transform into an editor.
You can pass an object with various configuration options to the EasyMDE constructor to customize each editor's appearance and behavior (e.g., toolbar, spellChecker, autosave). Refer to the EasyMDE documentation for a complete list of options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions