Insert a DOM node directly
insertNode is useful when you already have a real DOM element. This page inserts a theme badge card
instead of a plain string.
Hello from the editable area.
HTML output
Ready.
Example configuration - Node Insertion
summernote.create('#insertion-node-editor', {
height: 220,
});
const node = document.createElement('div');
node.className = 'badge text-bg-success';
node.textContent = 'Inserted DOM node';
summernote.invoke('#insertion-node-editor', 'insertNode', node);