Search
 
SCRIPT & CODE EXAMPLE
 

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);
      
    }
  }
Comment

PREVIOUS NEXT
Code Example
Javascript :: for object 
Javascript :: object deep copy 
Javascript :: fixed menu reactjs 
Javascript :: reverse words in a string javascript 
Javascript :: js get url variables 
Javascript :: reactjs hello world 
Javascript :: nestjs vscode debug 
Javascript :: react proxy 
Javascript :: filereader check file type 
Javascript :: distance to km javascript 
Javascript :: StatusBar 
Javascript :: javascript long integer 
Javascript :: mongoose reset database 
Javascript :: javascript new date dd/mm/yyyy 
Javascript :: open pdf in browser javascript 
Javascript :: event.preventdefault is not a function jquery 
Javascript :: array without duplicates js 
Javascript :: display content in a modal react 
Javascript :: conditional style react native 
Javascript :: es6 iife 
Javascript :: access django template variable in javascript 
Javascript :: js text to html 
Javascript :: sequelize order with include 
Javascript :: javascript log to console 
Javascript :: javascript for each loop 
Javascript :: js arithmetic operators 
Javascript :: change title react 
Javascript :: add regexp to antd 
Javascript :: how to get element by id in node js 
Javascript :: offsetheight javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =