Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

171
Vistas
Javascript function doesn't work when chrome auto-fill forms

I have a login form where, if the fields are filled with data, a javascript (jquery) adds a class to them.

The problem appears when the fields are auto-filled by Google Chrome if you save the access credentials. Is there a way to check if Chrome (or any other browser) has autofill the field and launch the JS function so the correct classes are applied?

EDIT giving any input from the keyboard/mouse, the script is fired and it works correctly. Unfortunately, I want it working without user input but o page load.

Example below

main.html

<input type="password" class="input100" name="password">

main.js

$('.input100').each(function(){
        $(this).on('blur', function(){
            if($(this).val().trim() != "") {
                $(this).addClass('has-val');
            }
            else {
                $(this).removeClass('has-val');
            }
        })    
    })
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda