I am trying to achieve that when the user presses the reset button, the cursor positions back to the beginning of the input.
Can anyone guide me on how to achieve this?
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>