Hello,
I'm trying to use the command ID 'Delete' with execCommand but oddly it's deleting too much of my code !!
I'm using a WYSIWYG editor on my webpage...so I'm selecting my image and I click on the "Add/modify link" button.
And at the end I click on OK to apply the modification.
here is in (very) short the end of javascript code :
var GetElem = editdoc.selection.createRange();
GetElem.execCommand('Delete');
when I check what is in GetElem by using GetElem.htmlText I have this :
<A href="../texteleg/etudes/dc050994/chapitre_i.htm#1"><IMG height=16 src="../../Images/retour.gif" width=16 border=0></A>
the "full" HTML from where this comes from is :
<DIV align=center></DIV><A name=1></A><A href="../texteleg/etudes/dc050994/chapitre_i.htm#1"><IMG height=16 src="../../Images/retour.gif" width=16 border=0></A><B><U>Article 1er</U></B>
And the problem is when I do GetElem.execCommand('Delete');
it also deletes the <A name=1></A> !!
Anyone has any idea why the anchor that doesnt seem to be in the range is deleted aswell ?
Thanx in advance for help
I'm trying to use the command ID 'Delete' with execCommand but oddly it's deleting too much of my code !!
I'm using a WYSIWYG editor on my webpage...so I'm selecting my image and I click on the "Add/modify link" button.
And at the end I click on OK to apply the modification.
here is in (very) short the end of javascript code :
var GetElem = editdoc.selection.createRange();
GetElem.execCommand('Delete');
when I check what is in GetElem by using GetElem.htmlText I have this :
<A href="../texteleg/etudes/dc050994/chapitre_i.htm#1"><IMG height=16 src="../../Images/retour.gif" width=16 border=0></A>
the "full" HTML from where this comes from is :
<DIV align=center></DIV><A name=1></A><A href="../texteleg/etudes/dc050994/chapitre_i.htm#1"><IMG height=16 src="../../Images/retour.gif" width=16 border=0></A><B><U>Article 1er</U></B>
And the problem is when I do GetElem.execCommand('Delete');
it also deletes the <A name=1></A> !!
Anyone has any idea why the anchor that doesnt seem to be in the range is deleted aswell ?
Thanx in advance for help