私はこれがwindow.getSelection()メソッドを使用することでjavascriptで可能であることを知っていますが、私はこの選択オブジェクトに精通していません。ユーザーの書き込みカーソルが常に入力文字列の先頭にくるようにコードを書くのを手伝ってもらえますか?
$('input[type="text"]')
.attr('maxlength','7')
.keyup(function(){
var sel = window.getSelection();
console.log(sel);
// need a code for here to make the cursor (caret) at the begining of the string
})