Answers for "javascript focus on contenteditable not working"

0

javascript focus on contenteditable not working

//so p is basically your element you want to focus correctly
var p = document.getElementById('contentEditableElementId'),
    s = window.getSelection(),
    r = document.createRange();
r.setStart(p, 0);
r.setEnd(p, 0);
s.removeAllRanges();
s.addRange(r);
Posted by: Guest on March-30-2022

Code answers related to "javascript focus on contenteditable not working"

Code answers related to "Javascript"

Browse Popular Code Answers by Language