How ro get reference of dom element where cursor is currently positioned. I need to use reference of dom element to add style attributes to it.
Suppose current curser position is after 'Rah' in ckeditor.
How can I get reference of span element surrounding "Rah".
Thanks.
Suppose current curser position is after 'Rah' in ckeditor.
<div><span>Rahul</span></div>
How can I get reference of span element surrounding "Rah".
Thanks.
Re: How to get reference of dom element where cursor is plac
where your_editor probably is "this" if you use that code from within CKEditor.
Re: How to get reference of dom element where cursor is plac
Thanks a lot. Worked fine in all browsers except IE.
In Internet Explorer (IE8) when there is no selection(only cursur is placed in CKEditor).
selection object returned is null.
I also tried editing CKEditor samples distributed and faced same problem in api.html sample too.
Modified api.html sample code:
IE is behaving differently. Is this a known issue.
Any other way to get reference of dom element where cursor is placed in IE?
Re: How to get reference of dom element where cursor is plac
In IE
is returned as null when there is no selection and cursor position is on text element(Span in my case).
Sample demonstrating this IE bug:
I hope there is a possible workaround.
Thanks
Re: How to get reference of dom element where cursor is plac