代碼: 選擇全部
<html>
<body>
<script language=vbscript>
function test()
Set objSelection = Document.Selection.CreateRange()
Msgbox objSelection.text
end function
</script>
<script language=javascript>
function test2()
{
alert(document.selection.createRange().text);
}
</script>
this is a test string!!
<input type=button value="show select" onclick="test()">
<input type=button value="show select2" onclick="javascripttest2();">
</body>
</html>
參考:
http://www.blueshop.com.tw/board/show.a ... 6152641OLG
http://www.microsoft.com/technet/script ... y0106.mspx