Issue #786šŸ’¬ AnsweredOpened January 22, 2018by perfect-coders0 reactions

How to get the next and previous models/elements of selected element

Quick answerby JulyanoF

When you say "element", you are talking about blocks? Like button, text, section...?

Read full answer below ↓

Question

I am cloning an element. I want to get the next element or previous element. By this I mean to say that How can I get the model or How should I give some custom attribute to the cloned element.

Thanks in Advance.

Answers (3)

JulyanoF• January 22, 2018

When you say "element", you are talking about blocks? Like button, text, section...?

perfect-coders• January 22, 2018

yes

JulyanoF• January 22, 2018

You can get all blocks like this: var blocks = editor.BlockManager.getAll().models;

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.