<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <script src="js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
    </head>
    <body>
        <h1>这是h1</h1>
        <h1>这是h2</h1>
        <h1>这是h3</h1>
        <h1>这是h4</h1>
        <script type="text/javascript">
//            document.querySelector('h1').style.background='skyblue';
//            document.querySelector('h1').style.fontSize="50px";

            var list=document.querySelectorAll('h1')
            for(var i=0;i<list.length;i++){
                list[i].style.background='skyblue',
                list[i].style.fontSize='100px'
            }

//            $('h1').css({
//                background:'red',
//                fontSize:'100px',
//                color:'skyblue'
//            })
//            
        </script>
    </body>
</html>

 

相关文章:

  • 2022-12-23
  • 2021-10-18
  • 2021-11-19
  • 2021-09-21
  • 2022-12-23
  • 2021-05-24
  • 2022-03-08
  • 2021-12-24
猜你喜欢
  • 2022-01-03
  • 2022-12-23
  • 2021-05-31
  • 2021-12-15
  • 2021-08-12
  • 2022-12-23
  • 2021-05-01
相关资源
相似解决方案