Hi all,
I allow me to ask a question, because I have a little probleme with an function which returns me the parent of a selection.
$('input[type=button].btn_transform').click(function(){
var selectionObj = getSelected();//Function which gives me selection
var theParent=selectionObj.anchorNode.parentNode;
alert (theParent);
})
For example with this sentence : "the cat is <strong>
gray</strong>
."
If I select manually the word "gray" and click on my button, the function returns me [object HTMLSpanElement].
But if I select the same word by double clicking, the function returns me [object HTMLParagraphElement].
Do you know why ?
Thanks a lot.