Issue #2183💬 AnsweredOpened August 6, 2019by sherngar1 reactions

Can i add my own attribute inside the BlockManager.add ?

快速解答by artf1

It works as expected https://jsfiddle.net/90y7wuo8/ Next time create a reproducible demo

Read full answer below ↓

Question

editor.BlockManager.add('testBlock' + i, { label: 'Box' + i, attributes: { MyAttribute: 'hi'}, content: html })

Can i do something like that ? or i need to use standard html attributes?

I tried, but didn't work

Thank you.

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

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.