For example IE has Range.pasteHTML method, and what about FF?
Delete the existing contents and create the new contents with the DOM e.g.
var selection = window.getSelection();
var range = selection.getRangeAt(0);
if (range) {
range.deleteContents();
var newContents = document.createElement('span');
newContents.textContent = 'Kibology for all.';
range.insertNode(newContents)
}
--
Martin Honnen
http://JavaScript.FAQTs.com/
Martin, I've actually been thinking about this quite a bit lately -- in
the context of transactions (do, undo, redo). It's not clear at all how
to do that correctly. Can you give me some advice?
Alex