直接设置下鼠标事件onmousedown

来源:互联网 发布:电子表格数据样板 编辑:程序博客网 时间:2024/05/20 11:46

如何设置textarea光标默认为第一行第一个字符

直接设置下鼠标事件onmousedown就可以的<body><script>function s(e,a){ if ( e && e.preventDefault )            e.preventDefault();else window.event.returnValue=false;a.focus();}</script><textarea id="anan" onmousedown="s(event,this)"></textarea></body></html>
阅读全文
0 0
原创粉丝点击