Issue #2124💬 AnsweredOpened July 9, 2019by edward18930 reactions

Get html component video

快速解答by artf

Why on the editor canvas, the video component has a div in parent tag (video), whereas when I get html(editor.getHtml()), the div doesn't exist To make a component behave in a specific manner its view (what you see in canvas) can be completely different from its model (what you see when you export the code) so it's to...

Read full answer below ↓

Question

  • Why on the editor canvas, the video component has a div in parent tag (video), whereas when I get html(editor.getHtml()), the div doesn't exist Screenshot_2

  • is it possible if I want to add 1 div as a parent again? (for stye css)

<div>
	<div data-gjs-type="video" >
		<video ></video>
	</div>
</div>

Answers (1)

artfJuly 14, 2019

Why on the editor canvas, the video component has a div in parent tag (video), whereas when I get html(editor.getHtml()), the div doesn't exist

To make a component behave in a specific manner its view (what you see in canvas) can be completely different from its model (what you see when you export the code) so it's totally ok

is it possible if I want to add 1 div as a parent again? (for stye css)

As explained above, you can update the video view and use/add whatever you want

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.