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

245
Views
Image src is undefined

I have a modal and I want to show selected image in another div but I can't get image src it say undefined.

If there is a easier way to show selected image in spesific div please let me know.

function testFunction() {
    var imagesrc = document.getElementsByClassName("selected").src;
    document.getElementById("deneme").innerHTML = '<img src="' + imagesrc + '" >';
}
<div class="modal fade" id="hazirresim" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLongTitle">Kategori Hazır Resimleri</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <input type="image" src="images/lol-1.jpg" class="selectable" height="250" width="250" style="padding-right: 3px;padding-bottom: 3px;">
                <input type="image" src="images/lol-1.jpg" class="selectable" height="250" width="250" style="padding-right: 3px;padding-bottom: 3px;">
                <input type="image" src="images/lol-1.jpg" class="selectable" height="250" width="250" style="padding-right: 3px;padding-bottom: 3px;">
                <input type="image" src="images/lol-1.jpg" class="selectable" height="250" width="250" style="padding-right: 3px;padding-bottom: 3px;">
                <input type="image" src="images/lol-1.jpg" class="selectable" height="250" width="250" style="padding-right: 3px;padding-bottom: 3px;">
                <input type="image" src="images/lol-1.jpg" class="selectable" height="250" width="250" style="padding-right: 3px;padding-bottom: 3px;">
            </div>
            <div class="modal-footer">
                <button onclick="testFunction();" type="button" class="btn btn-info btn-lg btn-block">EKLE</button>
            </div>
        </div>
    </div>
</div>

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!