Textbox.io 2.x Documentation : editor.mode.set(mode)

Programmatically sets the editor's mode to either code or design mode.

Example

// put the editor instance explicitly into code mode
editor.mode.set('code');
 
 
//put the editor instance explicitly into design mode
editor.mode.set('design');

Parameters

modeStringEither code or design for code or design views respectively. If any other values are used, an error is thrown.

Returns

No return value.