怎样用js检测选中文字 选中了文字,然后按下“alt”按键,然后执行js 弹出该文字,js或jquery应该怎么写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script><title>无标题文档</title></head><body><div id="content">this is demo:[email protected]</div><script type="text/javascript">jQuery(function($){ $('#content').mouseup(function(e){ var userSelection, text; if (window.getSelection) { userSelection = window.getSelection(); } else if (document.selection) { userSelection = document.selection.createRange(); } try { text = userSelection.toString(); } catch (err) { text = userSelection.text; } alert(text); });});</script></body></html> js在ie6下的加载问题?? 在子页面关闭时刷新父页面的问题,用到了弹窗控件 关于tabpanel中某个panel销毁的问题 我的歌词是放在变量中的,怎么加入歌词文件 求一张 游戏人物行走全过程图片(在线等) jsp中复选框的值的问题 如何实现数字分页 js请问如何阻止事件的连续发生呢? 当点击"修改密码"文字时,用js如何实现 弹出一个小的对话框提示"请输入原密码"输入完原密码点击确定后再弹出对话框提示"请输入修改后密码" 怎样禁止table中许多text元素被写入? swfupload异常 greybox页面传值
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<title>无标题文档</title>
</head><body><div id="content">this is demo:[email protected]</div><script type="text/javascript">
jQuery(function($){
$('#content').mouseup(function(e){
var userSelection, text;
if (window.getSelection) {
userSelection = window.getSelection();
} else if (document.selection) {
userSelection = document.selection.createRange();
}
try {
text = userSelection.toString();
} catch (err) {
text = userSelection.text;
}
alert(text);
});
});
</script>
</body>
</html>