How to get pictures of all the nodes in the page

Get the picture here node refers to the <img>, for some defined set of self-node background is not taken, we use: document.images

[...document.images].forEach(item=>console.log(item.src));

 

Note: The code above uses the syntax ES6: ..., it is converted to an array of array object class, then the method forEach img src attribute value of each element in the print node.

Guess you like

Origin www.cnblogs.com/aisowe/p/11533531.html