-/html/PUBL "IC DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
new document
<script> <BR> String.prototype.trim = function( ) { <BR> return this.replace(/^s |s $/g, ""); <BR> } /p. 🎜 > try{<BR> // IE: document.selection.createRange() W3C:window.get . ument.selection.createRange )? document.selection.createRange(). text : window.getSelection().toString();<BR> if(selectText != null && selectText.trim() != " }<BR> }catch(err ){}<BR> } <BR> /* 方法二*/<BR> function getSelectText2(id) {<BR> var t = document.getSelectText2(id) {<BR> var t = document.getSelectText2(id) {<BR> var t = document.getElementBget.); > if(t.selectionStart != undefined && t.selectionEnd != undefined) {<BR> return t.value.substring(t.selection) <BR> }<BR> } else {<BR> return document.selection.createRange().text;<BR> }<BR> <BR> document.getElementById('show').innerHTML = getSelectText2('content');<BR> }<BR></script>
> 🎜>