In order to add custom attributes to an HTML element that is generated by GrapesJS, one can simply make use of traits. For example, if you wish to produce an HTML element which contains the tag data-noout
, a trait with the name data-noout
can be added to a custom component.
var domComps = editor.DomComponents;
var dType = domComps.getType('default');
var dModel = dType.model;