Issue #3492Opened May 27, 2021by iabhiyaan0 reactions

FEAT: insertAdjacentHTML('afterend', '<section></section>') . Is there any api like this in grapesjs ?

Question

Is there any way to add new section after the selected component using grapesjs ?

Answers (1)

artfMay 27, 20210 reactions

You can do it in this way:

const cmp = editor.getSelected();
cmp.parent().append('<section>...</section>', { at: cmp.index() + 1 });

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.