S
sentinel
Hi,
I’m trying to modify a DHTML editor that parses a style-sheet
via PHP and instead of modifying the tags via execCommand(), find a
way of writing inline styles by way of adding <span style=> tags
around the selected text.
Easier said than done. My first though was to do a search and replace
on the innerHTML, but falls down if there is more than one match (it
will only modify the first occurrence). I suspect that even if I could
find the text around the selected area, this could still fall down for
same reason.
So, I’ve got the selected text via the createTextRange() method.
How do I modify this text and write it back out to the textarea.
I suspect finding a way of finding the positioning within the
innerHTML would be useful, so any suggestions will be appreciated.
Rgds
Neil.
I’m trying to modify a DHTML editor that parses a style-sheet
via PHP and instead of modifying the tags via execCommand(), find a
way of writing inline styles by way of adding <span style=> tags
around the selected text.
Easier said than done. My first though was to do a search and replace
on the innerHTML, but falls down if there is more than one match (it
will only modify the first occurrence). I suspect that even if I could
find the text around the selected area, this could still fall down for
same reason.
So, I’ve got the selected text via the createTextRange() method.
How do I modify this text and write it back out to the textarea.
I suspect finding a way of finding the positioning within the
innerHTML would be useful, so any suggestions will be appreciated.
Rgds
Neil.