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

182
Vistas
How to display an image only when I am in an input

In one of my projects I would like to display an image when I write in my input.

I have already written this code with HTML and Bootstrap which already allows me to display the image when I click on my input :

<div class="form-floating mb-3 bg-image hover-zoom">
     <input class="form-control" id="chemin_ad" name="chemin_ad" type="text" placeholder="Chemin dans l'AD" data-bs-show="collapse" data-bs-target="#exempleImage" aria-expanded="false" aria-controls="exempleImage" />
     <label for="chemin_ad">Chemin dans l'AD</label>
</div>

<div class="collapsing" id="exempleImage">
     <img class="img-fluid" src="<?php echo $chemin ?>assets/img/exemple.png" alt="Chemin de l'AD"/>
</div>

Great ! but when I leave the input the image remains displayed and I need to click again on the input to make it disappear...

Is there a way I can only display it when I'm inside my input with Bootstrap? Or with a JavaScript function?

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

0

Using JavaScript onblur

 <input type=text id=... onblur=document.getElementById('image').hidden = true;>
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