How to select nested DOM elements inside 'ul' element

前端 未结 3 1895
北海茫月
北海茫月 2021-02-04 06:24

I am looking for a way to collect all tags and load then in an array using Mootool 1.1 or pure javascript.

    &l
3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-04 07:16

    // for the links of the first ul.menu on the page
    var menuLinks = document.getElement("ul.menu").getElements("a");
    // or you can get all links children of all uls with class menu
    var menuLinks = document.getElements("ul.menu a");
    

提交回复
热议问题