Set focus on start

Set focus to the beginning #

To set the focus to the beginning of the content after calling Redactor, you can use the focus option.

// HTML
<textarea id="#content"></textarea>

// Call Redactor
$R('#content', { focus: true });

Or set the option with data attributes.

// HTML
<textarea id="content" data-focus="true"></textarea>

// Call Redactor
$R('#content');

See the example.

Set focus to the end #

To set focus to the end of the content after calling Redactor you can use the focusEnd option.

// HTML
<textarea id="#content"></textarea>

// Call Redactor
$R('#content', { focusEnd: true });

Or set the option with data attributes.

// HTML
<textarea id="content" data-focus-end="true"></textarea>

// Call Redactor
$R('#content');

Please, see the example