firefox下如何得到一个文本框中高亮选中的文字? 不好意思发错地方了,我指的是javascript 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这样吗?<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>无标题文档</title></head><script> function selectsed() { alert(document.getElementById("test").value); }</script><body><form name="form1" method="post" action=""> <textarea name="textarea" id="test">fsdfds</textarea> <input type="button" onclick="selectsed()"></form></body></html> 找到答案了,分就给楼上的吧正确答案:<script language="javascript">function A(txt){ if(txt.selectionStart)//ff { alert(txt.value.substr(txt.selectionStart,txt.selectionEnd-txt.selectionStart)) } else alert(document.selection.createRange().text);}</script><input type='text' onmouseup="A(this)" value="abcdefghijklmn"/> 我在用php写网页时想编如下的两个网页,却怎么也实现不了,请大家帮忙啊! 在线等:php插入mysql错误 php开发用什么工具!! 在线等,这个正则表达式应该如何写? 有那个高人在linux上写过php吗? 各位请进: 菜鸟有小问题. 一个郁闷的session问题 好,有谁在 LINUX下配置过php吗? frame和session问题 咨询关于mysql_connect超时连接 关于脏词屏蔽,帮忙看看 加密的php文件要用什么来打开啊
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script>
function selectsed()
{
alert(document.getElementById("test").value);
}
</script>
<body>
<form name="form1" method="post" action="">
<textarea name="textarea" id="test">fsdfds</textarea>
<input type="button" onclick="selectsed()">
</form>
</body>
</html>
<script language="javascript">
function A(txt)
{
if(txt.selectionStart)//ff
{
alert(txt.value.substr(txt.selectionStart,txt.selectionEnd-txt.selectionStart))
}
else alert(document.selection.createRange().text);
}
</script>
<input type='text' onmouseup="A(this)" value="abcdefghijklmn"/>