JavaScript and querySelector

后端 未结 4 580
情话喂你
情话喂你 2021-01-25 03:55

I have this HTML:

Intermediate steps

\"intermediate
4条回答
  •  面向向阳花
    2021-01-25 04:37

    Try this to return all src:

    map = Function.prototype.call.bind([].map);
    map(document.querySelectorAll(".image"), function(o){
        return o.src;
    });
    

    or set src just with

    o.src="whatever";
    

    Here is the Fiddle.

    Look MDN for compatibility of map.

提交回复
热议问题