I'm looking for a way to programmatically select specific text inside of an input or textarea.
E.g.
$('#my-input').val(); // "This is some text"
I'm aware that .select()
will select all contents in the input field.
Any way to programmatically select just the word "text" with no user interaction?