Actually, editor[0] is the element rather than a JQuery result. That won't work in the code that assumes it can apply JQuery actions to it, i.e. selectMode.