In HtmlEditor editor there was some text.
this.editor.execCmd('InsertHTML', '<span id=' + id + '>'); this will insert only span into editor.. whole text will get disappeared after this line of execution.
when i tried var textTmp = this.editor.getValue();
textTmp doesnt contains anything except span..How to get the text in editor with sapn inserted at cursor,
You want to wrap the selected text inside <span id="xyz">...</span>?
Maybe the 'formatblock' command will work for that. Otherwise you will have to get the currently selected text and use InsertHTML to insert the span including that text (see HTMLEditor plugins for example).