Hello,
I am not able to get the selection object's start and end offsets in Opera (v9.50) when the selection is collapsed (i.e. just point and click instead of highlighting text). This is my simple test code, which works in FF and Safari but does not work in Opera.
<html>
<head>
<script type="text/javascript">
function showSelection()
{
userSelection = window.getSelection();
alert('Start: '+userSelection.anchorOffset+'\nEnd: '+userSelection.focusOffset);
}
</script>
</head>
<body>
<div onmouseup="showSelection();">
<p>Lorem ipsum dolor <strong>sit amet</strong></p>
</div>
</body>
</html>
When I select a text, it works, but just pointing and clicking always return the offsets as 0. What am I missing? Thanks in advance.