why string.length return undefined?
<p>In the popup window, selText does have the value "great," but the length is always <code>undefined</code>. Something related with the encoding of the string?</p>

<pre><code>var selText = document.getSelection(); //suppose "great" is selected
alert( "selected -&gt;" + selText + " len is " + selText.length);
</code></pre>
