Issue #2166✓ SolvedOpened July 24, 2019by froderf2 reactions

How to remove a block?

Quick answerby zgover2

You touched on a few questions here, but to get to your first in your headline; reference the BlockManager api docs here e.g.

Read full answer below ↓

Question

editor.DomComponents.getWrapper().getEl().insertAdjacentHTML('beforeBegin', letBlock)

letBlock letblock is a variable that contains HTML.

Question:

  1. How to remove this adjacent HTML?
  2. is there a function like "insertAdjacentCSS()"?

Answers (3)

👍 Most helpfulzgoverJuly 24, 2019

You touched on a few questions here, but to get to your first in your headline; reference the BlockManager api docs here

e.g. BlockManager.remove('custom-block-id')

artfJuly 25, 2019

You're mixing too much stuff in one question and without any context

froderfJuly 26, 2019

@artf I just wanted to remove the new block that I added via editor.DomComponents.getWrapper().getEl().insertAdjacentHTML();

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.