I am trying to get the selected element and check if it is img tag or any other tag. I am using below code to get the selected/highlighted element in ckeditor.
var selectedElement = editor.getSelection().getStartElement();
It is working fine in chrome, firefox and edge browser but returns null in safari browser.
Is there any alternative way to get this in safari browser?