Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
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 answers
Answer question

0

Using JavaScript onblur

 <input type=text id=... onblur=document.getElementById('image').hidden = true;>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!