Issue #1499πŸ’¬ AnsweredOpened October 10, 2018by coder-strange0 reactions

Is it possible to perform dom manipulation through the block's contents script?

Quick answerby artf

Sure, but be sure to understand correctly the context of script and how it works https://grapesjs.com/docs/modules/Components-js.html#components-js You can't use $ if you didn't include it first

Read full answer below ↓

Question

Hey! First of all thank you so much to build such a great and versatile tool. Is it possible that I can manipulate the dom elements of the block through block's content script? Eg. Basically I need a survey kinda block, where user can drop question block and then can enter the question string. Once again thank you so much.

Answers (3)

coder-strangeβ€’ October 11, 2018

@artf I've added the jquery, in the above image I've added the value attribute to input tag as we can see that in the above image, but that value attribute is not there in the final HTML I'm getting from the editor.

artfβ€’ October 12, 2018

Use the latest version please

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.