javascript - How to get value of textarea field in HTML using Traits in GrapesJS -
i follow example making new traits type, it's working. want specific textarea value show in html in grapesjs.
editor.traitmanager.addtype('textarea', { events:{ 'keyup': 'onchange', // trigger parent onchange method on keyup }, /** * returns input element * @return {htmlelement} */ getinputel: function() { var selectedmodel = this.target; var input = document.createelement('textarea'); input.value = selectedmodel.get('textarea'); return input; }, /** * triggered when value of model changed */ onchange: function () { this.target.set('textarea', this.model.get('value')); } }); { type: 'textarea', name: 'textarea' }
Comments
Post a Comment