Answer the question
In order to leave comments, you need to log in
How to move the input cursor to the beginning of the line on focus?
function moveCaretToStart(inputObject)
{
if (inputObject.createTextRange)
{
var r = inputObject.createTextRange();
r.collapse(true);
r.select();
}
}
$('.bro-form-phone').focus(function() {
moveCaretToStart(document.getElementById("mytextbox"));
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question