How to get all the links of a list inside a div?

后端 未结 4 1232
天命终不由人
天命终不由人 2020-12-13 00:20

I have a code with the following DOM Tree:

4条回答
  •  温柔的废话
    2020-12-13 01:22

    The Vannila Javascript Solution

    Array.prototype.map.call(document.querySelectorAll(".myselectorAreaofLinks"), function (e) {
      return e.getAttribute('href');
    });
    

提交回复
热议问题