function getSelectText() {
    return document.selection && document.selection.createRange().text || window.getSelection && window.getSelection() || document.getSelection && document.getSelection() || '';
}

 

相关文章: