Sunday, 12 September 2021

get src by id

for dyanmic images display image on popup 


 function showImage(i) {

  

   

        var img = document.getElementById('img_'+i);

        img.className = 'element';


        var modalImg = document.getElementById("img01");

        var captionText = document.getElementById("caption");


        modal.style.display = "block";

        modalImg.src = img.currentSrc;

        captionText.innerHTML = this.alt;

    }


read this link to know how to access the subnode of each element

for example get src.



No comments:

Post a Comment

HCL healthcare

 hcl health care f2f second round interview asked more uestions on microservice 1.apim manage all apis in one place 2.sql profiler in one fo...