I'm having trouble selecting all contents of the div. Here's a demo:
http://jsfiddle.net/KcX6A/304/
It's selecting only the first line of texts, the other lines are ignored. How can I fix this?
EDIT:
By browser is google chrome
SECOND EDIT:
Too bad i'd be answering my own question. But here i've got it to work on Google Chrome:
I've replaced
selection.setBaseAndExtent(text, 0, text, 1);
with
selection.selectAllChildren(text);
and it worked like a charm! Please guys inform me if it works with other browsers as well.