SCEditor

focus()

focus() Since: 1.3.0

Focuses the editor.

Syntax

instance.focus();

Return

Type: sceditor

focus(func) Since: 1.4.1

Binds a handler to the focus event. This is just a shortcut for:

instance.bind('focus', func[, excludeWysiwyg][, excludeSource]);

Syntax

instance.focus(func[, excludeWysiwyg][, excludeSource]);

Parameters

func
Type Function

Function that will be called when the event occurs

excludeWysiwyg
Type: Boolean
Default: false

If to not bind the event to the WYSIWYG editor.

excludeSource
Type: Boolean
Default: false

If to not bind the event to the source editor.

Return

Type: sceditor

Example

var textarea = ...;
sceditor.instance(textarea).focus(function(e) {
	alert('Gained focus');
});