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

161
Vistas
How do I detect the event when tab on an input?

How do I detect the event when tapping on an input?

I have a form where I have 5 inputs. I need to add a ccs class that changes the color of the label when the user changes from one input to another by tab

const InputGroup = function () {
  const greating = function (e) {
    console.log(e.target.value);
    console.log("only clicked");
  };
  return (
    <div className="input-group-with-icons">
      <label htmlFor="name" className="form-label">
        Name:
      </label>
      <div className="input-group">
        <span className="input-group-text iconify" id="basic-addon1" data-icon="carbon:string-text" data-width="50" data-height="50"></span>
        <input type="text" className="form-control" placeholder="Name" aria-label="name" aria-describedby="basic-addon1" name="name" onClick={greating} />
      </div>
    </div>
  );
};
export default InputGroup;

I can't find a way to detect the tab event

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use the focus event to detect focus in Javascript:

<input type="text" onfocus={focusinhandler} onfocusout={focusouthandler} />

If your goal is to changing styling, you can use the :focus selector in CSS:

.input-group-text.iconify:focus {
    // Colour Change
}

which is applied when an element gains focus.

about 4 years ago · Juan Pablo Isaza Denunciar
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