Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript press tab key

window.onkeypress = function(e) {
    if (e.which == 13) {
       e.preventDefault();
       var nextInput = inputs.get(inputs.index(document.activeElement) + 1);
       if (nextInput) {
          nextInput.focus();
       }
    }
};
Comment

javascript press tab key

window.onkeypress = function(e) {
    if (e.which == 13) {
        e.preventDefault();
        var inputs = document.getElementsByClassName('input');
        for (var i = 0; i < inputs.length; i++) {
        if (document.activeElement.id == inputs[i].id && i+1 < inputs.length ) {
            inputs[i+1].focus();
            break;   
        }
    }
Comment

javascript press tab key

var inputs = $(':input').keypress(function(e){ 
    if (e.which == 13) {
       e.preventDefault();
       var nextInput = inputs.get(inputs.index(this) + 1);
       if (nextInput) {
          nextInput.focus();
       }
    }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: add in to array mongoose 
Javascript :: js throw new error 
Javascript :: js how to calculate factorial 
Javascript :: search through json for key 
Javascript :: sequelize include twice 
Javascript :: post to /wp-json/wp/v2/media 
Javascript :: javascript deconstruct object 
Javascript :: javascript async/await 
Javascript :: javascript optional add object key 
Javascript :: javascript objectentries 
Javascript :: vuejs set default value for prop 
Javascript :: javascript add dom disabled 
Javascript :: get filenem js 
Javascript :: conditional (ternary) operator function parameter 
Javascript :: rect to rect collision 
Javascript :: open youtube video at specific time javascript 
Javascript :: function countdown() 21 sec 
Javascript :: input from terminal node js 
Javascript :: how to sho the active navigation ling using javascript 
Javascript :: subtrair datas javascript frontend 
Javascript :: apollo clear cache for query 
Javascript :: slick js function 
Javascript :: react router history not defined 
Javascript :: npm hook form 
Javascript :: returned value by findOneAndUpdate 
Javascript :: how to select a few properties from an object javascript 
Javascript :: using hooks with apis 
Javascript :: javascript replace ios apostrophe 
Javascript :: how get count of letters in javascript 
Javascript :: angular how to copy text with button 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =