最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to select current element in CKEditor..? - Stack Overflow

programmeradmin0浏览0评论

I want to select current(cursor position) element in CKEditor using java script.

When right click event happens i have to select an element where i am right clicking.

I want to select current(cursor position) element in CKEditor using java script.

When right click event happens i have to select an element where i am right clicking.

Share Improve this question edited Jul 17, 2012 at 11:33 Ramesh asked Jul 17, 2012 at 10:13 RameshRamesh 1,0836 gold badges26 silver badges53 bronze badges 2
  • 1 What do you mean by "current (cursor position) element"? – Reinmar Commented Jul 17, 2012 at 11:11
  • i am using context menu item. when an context menu button clicked i have to select that element where the click happens. – Ramesh Commented Jul 17, 2012 at 11:35
Add a ment  | 

1 Answer 1

Reset to default 7

This is the solution you're looking for:

var editor = CKEDITOR.instances.editor1,
    sel = editor.getSelection();

sel.selectElement(sel.getStartElement());
发布评论

评论列表(0)

  1. 暂无评论