Issue #1233💬 AnsweredOpened June 25, 2018by JPPreusDev0 reactions

How to grab the html code using javascript

快速解答by cjpollard

https://github.com/artf/grapesjs/wiki/API-Editor#gethtml

Read full answer below ↓

Question

I would like to grab the contents of the created HTML document using javascript so I can submit it using a form. How would I select the HTML content?

Answers (3)

ivanezeigboJune 25, 2018

These two lines of code give you the html and the css

var Html = editor.getHtml(); var Css = editor.getCss();

JPPreusDevJune 30, 2018

Great! Thank you.

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.