▲如何实现光标的移动呢?

如何实现光标的移动?
---------------------------------------------------------------

1<input onclick="go(-1)" type="button" value="&lt;"/>
1<input id="demo" value="press button"/>
1<input onclick="go(1)" type="button" value="&gt;"/>
1<script>   
2function go(n){   
3demo.focus();   
4with(document.selection.createRange()){moveStart("character",n);collapse();select();}   
5}   
6</script>
Published At
Categories with Web编程
comments powered by Disqus