Using Selectionstart On Programmatically-created Inputs
Is it possible to set and get .selectionStart and .selectionEnd on a
Solution 1:
var input = document.createElement("textarea");
// Add the manually created element to the document body
document.body.appendChild(input);
// Just added to confirm visually
input.textContent = "Something clever here";
input.selectionStart = 2; // returns 2
input.selectionEnd = input.textLength - 2;
Post a Comment for "Using Selectionstart On Programmatically-created Inputs"