The editor's mode object provides functions to switch the editor into code and design views respectively

 

Methods

editor.mode.get()Retrieves the HTML contents of an instance's content <body> element.
editor.mode.set(String mode)

Sets the editor mode type to either code or design view