I need the equivalent to the getRangeAt() method in Internet Explorer before version 9
if (window.getSelection) {
sel = window.getSelection();
if (sel.rangeCount) {
range = sel.getRangeAt(0);
}
} else if (document.selection && document.selection.createRange) {
// What shall I write here to do the same thing in IE before version 9
}
var table = document.createElement("table");
table.border = 1;
table.className = "tabley";
range.insertNode(table);