I am trying to get an image url from an html that has an img srcset using javascript. I am particularly interested in getting 2nd or 3rd image.
Example of srcset within html:
<img srcset=\"http:example.jpg 140w,http:example.jpg 160w,http:example.jpg 320w,http:example.jpg 480w,http:example.jpg 720w,http:example.jpg 1280w,http:example.jpg 1500w\" src=\"http:example.jpg\" alt=\"example\">
I can only use pure javascript.
Any help will be much appreciated as I've already spent hours trying to get this work and the only success I had so far is to get all of those links out of html.