For Netscape/Mozilla you can get the "parent node" of a selection using the following code...
Code: Select all
var selection = window.getSelection();
rng = selection.getRangeAt(selection.rangeCount - 1).cloneRange(); parentnode=rng.commonAncestorContainer;Code: Select all
var selection = document.selection;
if (selection != null) { rng = selection.createRange(); }
// Need the equivalent to rng.commonAncestorContainer Here