Skip to main content
se añadieron 177 caracteres en el cuerpo
Origen Enlace

yo tengo uno mas resumido HTML

  //solo numeros 
  $('.input-number').on('input', function () { 
          this.value = this.value.replace(/[^0-9]/g,'');
        });
//con letras y numeros 
 $('.form-control').on('input', function () {  
  this.value = this.value.replace(/[^0-9a-zA-ZñÑáéíóúÁÉÍÓÚ.(),@ _-]/g,'');
});
        
  
 <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
 <input type='text' class='form-control input-number'
     id='coordenaday_mass' maxlength='45'   required='required' autofocus>
JAVASCRIPT

  

yo tengo uno mas resumido HTML

  
  $('.input-number').on('input', function () { 
          this.value = this.value.replace(/[^0-9]/g,'');
        });
        
  
 <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
 <input type='text' class='form-control input-number'
     id='coordenaday_mass' maxlength='45'   required='required' autofocus>
JAVASCRIPT

  

yo tengo uno mas resumido HTML

  //solo numeros 
  $('.input-number').on('input', function () { 
          this.value = this.value.replace(/[^0-9]/g,'');
        });
//con letras y numeros 
 $('.form-control').on('input', function () {  
  this.value = this.value.replace(/[^0-9a-zA-ZñÑáéíóúÁÉÍÓÚ.(),@ _-]/g,'');
});
        
  
 <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
 <input type='text' class='form-control input-number'
     id='coordenaday_mass' maxlength='45'   required='required' autofocus>
JAVASCRIPT

  

Origen Enlace

yo tengo uno mas resumido HTML

  
  $('.input-number').on('input', function () { 
          this.value = this.value.replace(/[^0-9]/g,'');
        });
        
  
 <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
 <input type='text' class='form-control input-number'
     id='coordenaday_mass' maxlength='45'   required='required' autofocus>
JAVASCRIPT