<input id=demo value="try and try"><input type=button onclick="go()">
<script>
function go(){
demo.focus();
with(document.selection.createRange()){moveStart("character",0);collapse();select();}
}
</script>
<script>
function go(){
demo.focus();
with(document.selection.createRange()){moveStart("character",0);collapse();select();}
}
</script>
解决方案 »
- 如何让JS函数只执行一次?
- 请教一个正则表达式
- 不理解闭包和事件绑定内存泄露问题,有代码,右图,欢迎进来
- 问下jquery的filetree怎么样使用?
- jQuery基础问题????在线等...急急急急急急
- 多首音乐连续播放问题??????
- [Help]代码冲突
- 变量传递的一个小问题
- jquery IE8下 attr的bug? 怎么解决
- 奇怪的问题,关于select的当前显示项
- 请问如知道<textarea里面的文字有多少行了?并且,每一个后加入一个“|”,请问如何实现,我想java高手应该没有问题吧。代码如下。
- 请问,如何触发这个function aaa(),要求不能用<body onkeypress="aaa()">形式!!
<script>
function go(){
with(document.selection.createRange()){moveStart("character",-demo.value.length);collapse();select();}
}
</script>