How can i set pointer position? I tried the most famous solution from this topic: Set keyboard caret position in html textbox But this solutions work just in input...
This is the code:
$(document).ready(function(){
$("#asd").keypress(function(){
//set cursor to a position
})
});
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</head><body>
<pre id="asd" contenteditable="true" >
asd
</pre>
</body>
</html>