Вопрос по javascript, jquery, html, validation – Как выделить часть части поля ввода текста в HTML, используя Javascript или JQuery

11

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceededgithub.com/garysieling/jquery-highlighttextarea rinogo
Error: User Rate Limit Exceeded Bergi
Error: User Rate Limit Exceededstackoverflow.com/questions/119441/highlight-a-word-with-jqueryError: User Rate Limit Exceededstackoverflow.com/questions/3318229/… ? nuala
Error: User Rate Limit Exceeded ramcdougal
Error: User Rate Limit Exceeded rinogo

Ваш Ответ

1   ответ
19

selectionStartselectionEndsetSelectionRange()

var input = document.getElementById("textBoxId");
input.value = "Cup of tea";
input.setSelectionRange(0, 3); // Highlights "Cup"
input.focus();

TextRange

Error: User Rate Limit Exceededjsfiddle.net/MvBeU
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededstackoverflow.com/questions/1481152/…Error: User Rate Limit Exceeded user6123723

Похожие вопросы