var txt = '';
var txtSql = document.getElementById('txtContent');
txt = (txtSql.value).substring(txtSql.selectionStart,txtSql.selectionEnd);
转载于:https://www.cnblogs.com/jerryhong/archive/2007/06/14/783809.html
转载于:https://www.cnblogs.com/jerryhong/archive/2007/06/14/783809.html