Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
      
    }
  }
 
PREVIOUS NEXT
Tagged: #On #pressing #enter #change #focus #input #field
ADD COMMENT
Topic
Name
8+4 =