Get the parent element of the current selection
if(this.getType() == "control"){ var p = this.getSelectedElement(); if(p){ return p.parentNode; } }else{ if(dojo.doc.selection){ //IE return dojo.doc.selection.createRange().parentElement(); }else{ var selection = dojo.global.getSelection(); if(selection){ var node = selection.anchorNode; while(node && (node.nodeType != 1)){ // not an element node = node.parentNode; } return node; } } } return null;