zoukankan      html  css  js  c++  java
  • ID选择器

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8" />
            <title></title>
            <script src="js/JQ3.3.1.js"></script>
            <link rel="stylesheet"  type="text/css" href="css/style.css"/>
            <script type="text/javascript">
                $(function(){//对div添加txt的样式
                    $(showMsg).attr("class","txt");//所有div都会有效果,其中txt是css中定义的样式
                    //$("#showMsg").attr("class","txt");//一次只会选中第一个div
                })
            </script>
        </head>
        
        <body>
            <div id="showMsg"><h1>test</h1></div>
            <div id="showMsg"><h1>test</h1></div>
            <span>test</span>
            <span>test</span>
            <p>test</p>
            <p>test</p>
        </body>
    </html>
  • 相关阅读:
    RabbitMq
    SAAS-HEM
    java框架
    数据结构
    JVM
    springboot高级
    面试题汇总
    vue
    bootforum
    SpringBoot
  • 原文地址:https://www.cnblogs.com/ssC2H4/p/8876213.html
Copyright © 2011-2022 走看看