A
A
Alexfixer2020-01-22 10:33:01
JavaScript
Alexfixer, 2020-01-22 10:33:01

How to insert a name in the Trumbowyg textarea on the answer button?

The answer button should insert "Kolya,"
https://jsfiddle.net/alexshev07/jx3o5peg/4

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Chefranov, 2020-01-22
@Alexfixer

jQuery('#editor').trumbowyg({});
jQuery('#editor').trumbowyg('html', '<h1>Welcome</h1>');

jQuery('#get-code').click(function() {
  var code = jQuery('#editor').trumbowyg('html');
  console.log(code)
});

$('.replay').click(function(){
$('#editor').trumbowyg('html', $('#editor').trumbowyg('html') + $(this).attr('data-name') + ', ');
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question