Home
Sign Up
Sign In
V2EX
›
问与答
有什么方法可以重设 contentEditable 的光标位置?
november
·
Dec 7, 2022
· 594 views
This topic created in 1261 days ago, the information mentioned may be changed or developed.
最近做一个输入框需要在里面添加样式,用 contentEditable 属性,基本原理就是在替换输入框内容的同时,也把光标位置重设一次。
但是问题来了,网上找的方案,都会在回车换行的时候出问题。
想问下有相关经验的人,是如何处理回车换行的光标定位问题的?
No Comments Yet
输入框
光标
回车
contentEditable
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
978 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 26ms ·
UTC 19:30
·
PVG 03:30
·
LAX 12:30
·
JFK 15:30
♥ Do have faith in what you're doing.
❯