I want to get the HTML/text contents of the Redactor editor I'm building a plugin for Craft CMS. This plugin will load on the edit/content page, where the standard Redactor WYSIWYG editor will be loaded too (by CraftCMS).
I want to get the HTML/text contents of the Redactor editor.

For example tinymce.activeEditor.getContent() will get the HTML contents of the TinyMCE editor in WordPress.

How do I achieve this in Craft CMS?

The API documentation says var text = this.clean.getPlainText(html);.
But how do I know reference to this.
I'm not 100% sure I follow, but I think this is what you are looking for.

In your javascript file, you'll want code.set

API Reference

...

$('#yourTextArea').redactor('code.set', your.data);