傳回所選擇的文字
document.getelection 可傳回所選擇的文字
程式碼如下:
<script>
function Event1(){
alert(document.getSelection());
}
</script>
abcdefghijklmnopqrstuvwxyz123456789...abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
<input type="button" value="Press to start" onclick="Event1()">