原生JS获取元素,添加事件

// 获取所有input
let inputAll = document.querySelectorAll('.table_input input');
this.iddata = inputAll;
// 向上 =38
if (item.keyCode === 38) {
newIndex -= 8;
if (inputAll[newIndex]) {
inputAll[newIndex].focus();
}
}
posted @ 2019-08-15 10:46  苏小白啊  阅读(1239)  评论(0编辑  收藏  举报