Issue #3715πŸ’¬ AnsweredOpened Aug 20, 2021by mingxin-yang0 reactions

How to add a click event

Quick answerby mingxin-yang

@artf

Read full answer below ↓

Question

This is my custom block code: I want to add a click event to the button after adding it to the canvas, and when I click it, I can get the content in the mj-text

Answers (3)

mingxin-yangβ€’ Aug 20, 2021

@artf

artfβ€’ Aug 29, 2021

@mingxin-yang you have to extend the view of the mj-button Component

GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @mingxin-yang. Great question about How to add a click event. The recommended approach with Canvas is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener method Most operations can be achieved...

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.