Textarea editor Redactor. Insert value with jQuery

If you are using an old version of redactor, you can try the set API, which I think is a lower-level version of insertText/insertHtml.

So in your example, it should be:

$('#tr').redactor('set', 'Your text goes here');

Update (2015-04-21): In redactor v2, the name of the set method was changed:

$('#tr').redactor('code.set', 'Your text goes here');

Another Update (2020-04-20): In their latest version, Imperavi changed their syntax and provided two ways to achieve this solution:

const editor = $R('#tr');
editor.source.setCode('Your text goes here');
    

or

$R('#tr', 'source.setCode', 'Your text goes here');