在html文件上选择,被选的文字需要变色
解决方案 »
- how to access data from jquery plugin's event?
- js innerHTML未知的运行时错误
- IE6和IE7兼容问题
- 求教jsp中table导出excel的例子
- 请教一个自动计算的问题
- 送一个数字金额转大写的函数(javascript),请指教!
- easyui datagrid 更改单元格值后getChanges无法获取
- 网页中有个简单的html在线编辑的功能,奇怪的在编辑区输入文字明明是文字的可以电脑上没有显示出来,出来是空格
- 怎样实现在文本框输入所要的内容,在列表框中动态查找。
- 极酷动作效果----------------最后100分,,,求救高手!!!
- 求在JavaScript中如何将回车符替换成<BR>的函数。
- 疑惑中....
<script>
function change()
{
document.all.txt.value=document.selection.createRange().text;
document.execCommand('forecolor',true,'#FF0000')
document.all.txt.focus()
}
</script>
<input type="text" size=60 name="txt">
<div onmouseup="change()">
retryryeeyereeeeeeeefvgfhfhfhdh中fffffffffffffffffffff3reeeeeeeeeeeeeddsgs
</div>
</body>