列表格式显示

- 分类

广告招商中......
联系方式!

- 时间排序 更多...
    - 点击排序 更多...
      - 大小排序 更多...
        作者

         

        最近发布的软件 更多>>

        首页 >> >> >>findElementWithText 发布者:blog >> 本人发布的更多软件

        广告招商中...... 联系方式!

        findElementWithText 

        时间:2024-06-23 18:17:17      作者:blog     访问量:  
        ;开始下载地址

        function findElementWithText(text) {

          const elements = document.querySelectorAll('*'); // 获取所有元素

          let foundElement = null;

         

          elements.forEach(function(element) {

            if (element.textContent.includes(text)) {

              foundElement = element;

              return; // 找到后退出循环

            }

          });

         

          return foundElement; // 返回包含文字的元素,如果没有找到则返回 null

        }



        var el_order=findElementWithText("价格从低到高");

        if (el_order!=null)

        el_order.click()


        本页Html网址:/htmlsoft/619365.html

        本页aspx网址:/soft.aspx?id=619365&bianhao=202406231815321589_98574&kind1=&kind2=

        最后访问时间:

        上一篇:JavaScript 如何实现滚动到指定元素位置的功能?

        下一篇:getBoundingClientRect();

        增加   


        相关评论        新窗口打开查看评论