I have a script that will get images from page, but how do I do it with conditions? Such as width/height size?
Right now I have this
(function(){
var imgs = document.getElementsByTagName("img");
var imgSrcs = [];
for (var i = 0; i < imgs.length; i++) {
imgSrcs.push(imgs[i].src);
}
}());
So I get all the tags that has img and it gets its sources, but how would i get images with conditions?
Is there a certain attribute I can get? Am I supposed to use if else situations?
Thanks!
Use can use attributes and make condition based on them.
For instance, imgs[i].style.width == “75px” or $(imgs[i]).width() == 75