[英]How to move caret position
這聽起來很簡單,但是我沒有運氣來移動光標。 我已經嘗試了許多方法,但是目前我所處的位置。 如果需要,我可以提供更多信息。
{
this.getMinute().addListener('spinup', this.SpinnerUp, this); //getMinute is the spinner field
}
...
timeSpinnerUp: function (field, e) {
el=this.getMinute().getEl(); // el.selection is not an option
}
HTMLInputElement.select()和/或HTMLInputElement.setSelectionRange()可以幫助您嗎?
https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/選擇 https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.