【发布时间】:2009-10-27 21:59:06
【问题描述】:
您可以从网站或任何网站轻松找到 focus() 答案。但我想知道的是,在我刚刚插入输入框后如何使用焦点。
$("input").val('@user').focus(); // this goes to start of the input box and foucs from start, but i want it to focus after the @user
$("input").val('@user today i did new things').focus(5); // i added 5 in focus method, obviously its not supported yet!, but the idea behind is, to focus it after @user from complete word.
已编辑:
我刚刚在 Firefox 上看到它工作正常,但在 chrome 中它从头开始启动光标。有什么解决办法吗?
【问题讨论】:
标签: javascript jquery focus mouse cursor