Answers for "On pressing enter change the focus to the next input field"

1

On pressing enter change the focus to the next input field

public focusNext(e) {
    console.log('here');
    try {
      for (let i = 0; i < this.inputsArraY.length; i++) {
        if (e.code === 'Enter' && e.target.id === this.inputsArraY[i]) {
         document.querySelector(`#${this.inputsArraY[i+1]}`)//.focus()
        }     
      }
    } catch (error) {
      console.log(error);
      
    }
  }
Posted by: Guest on October-14-2020

Code answers related to "On pressing enter change the focus to the next input field"

Code answers related to "Javascript"

Browse Popular Code Answers by Language