input放入焦点,选中全部文本

async mounted(){ 
   let inputList = document.querySelectorAll('input');
   for (let index = 0; index < inputList.length; index++) {
     inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
   }
}	
  
//全选文本
selectValue(e) {
	e.currentTarget.select();
}

posted on 2022-10-12 15:13  anjun_xf  阅读(448)  评论(0编辑  收藏  举报

导航

TOP