Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

247
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda