【发布时间】:2020-02-05 07:45:07
【问题描述】:
我正在尝试实现,当用户按下重置按钮时,光标会回到输入的开头。
谁能指导我如何实现这一目标?
function restore(){
// here need to set the position
};
p {
text-align:left;
padding:10px;
font-size: 20px;
font-family: "Open Sans";
border:1px black solid;
}
button{
font-size: 25px;
}
<p contenteditable="true"></p>
<button onclick="restore()">Restore</button>
【问题讨论】:
-
这是您要求的吗? stackoverflow.com/questions/512528/…
标签: javascript html css