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

90
Views
Displaying photos

Button works but does not display first photo unless clicked twice. Works well for all subsequent uploads...code below:

         function addImage(photo) {
                setAlbum([...album, photo]);
            }

            function getImage() {
                const imageDiv = document.getElementById('images');
                const img = document.createElement('img');
                img.src = URL.createObjectURL(photo);
                album.forEach((photo) => {
                    // const img = document.createElement('img');
                    // document.createElement('img');
                    imageDiv.appendChild(img);
                    // img.src = URL.createObjectURL(photo);
                });
            }

            function showImage() {
                const fileInput = document.getElementById('myFile');
                addImage(photo);
                if(fileInput.files.length === 1) {
                    getImage();
                    console.log('worked')
                    console.log(photo)
                    // getImage();
                    // addImage(fileInput.files[0]);
                } else {
                    console.log('fail')
                }
            }
about 4 years ago · Juan Pablo Isaza
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!