Use javascript/jQuery to get the src of images from a website | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Use javascript/jQuery to get the src of images from a website

Hai, I need to load a website using a javascript code and to get the details of img src s on that website by using JavaScript.Could anyone help me?

14th Aug 2017, 6:14 PM
Aneesh
1 Answer
0
you can use // var images = getElementsByTagName('image'); to get the image tags into an array and then use // for(i = 0;i <images.length; i++){ // var imgSrc = images[i].getAttribute('src'); // console.log(imgSrc); // } you can see the image src's in the console. ** correct me if im wrong
15th Aug 2017, 7:27 AM
Mashan Shaluka1
Mashan Shaluka1 - avatar