Reputation: 593
Hi I have the below image tag
<img class="CaptureViewer-image" src="data:image/jpeg;base64 alt="Photo of your document" aria-hidden="true">
I have the below image src using JQuery
$(".CaptureViewer-image").attr("src");
I want to pass the same image src to add the srcset in the above tag. I tried like this
var imagesrc = $(".CaptureViewer-image").attr("src);
$(".CaptureViewer-image").attr("srcset" , "imagesrc 300px");
when checked for the srcset value , the value is getting saved as imagesrc 300px instead of actual image source . I am trying to find the solution and learn in the process.Thanks.
Upvotes: 0
Views: 124