zoukankan      html  css  js  c++  java
  • 按css查询多个元素

    示例2 查询多个元素

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    <!DOCTYPE html>
    <html>
        <head>
            <title>访问元素</title>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <style>
                .mycolor{
                    color:#fff;
                    
                }
                .steam{
                    text-decoration: initial;
                }
            </style>
        </head>
        <body>
            <ul id="ul">
                <li id="a">油条</li>
                <li id="b" class="steam">包子</li>
                <li id="c" class="steam">米饺</li>
                <li id="d"><a>鱼粉</a></li>
            </ul>
            <script>
                // 返回多个元素节点
                var els = document.querySelectorAll('li.steam');
                els[0].className='mycolor';
            </script>
        </body>
    </html>
  • 相关阅读:
    https协议介绍
    最详尽的fidder抓取https请求
    最详尽的datagrip使用
    datagrip安装与破解
    二叉树
    使用nexus搭建maven私库
    markdown利器-小书匠
    java开发-flyway
    .NetCore 入门
    .Net Core 实体生成器
  • 原文地址:https://www.cnblogs.com/max-hou/p/11168044.html
Copyright © 2011-2022 走看看