Issue #3492πŸ’¬ AnsweredOpened May 27, 2021by iabhiyaan0 reactions

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

Quick answerby artf

You can do it in this way:

Read full answer below ↓

Question

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

Answers (2)

artfβ€’ May 27, 2021

You can do it in this way:

const cmp = editor.getSelected();
cmp.parent().append('<section>...</section>', { at: cmp.index() + 1 });
GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @iabhiyaan. Great question about FEAT: insertAdjacentHTML('afterend', '<section></section>') . Is there any api like this in grapesjs ?. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific...

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.