상세 컨텐츠

본문 제목

[J쿼리] 선택자 연습

카테고리 없음

by esoesmio 2023. 5. 23. 21:19

본문

<!--제이쿼리로 속성들 다바꾸기-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <script src ="./1.js" ></script>
    <script>
        //이렇게하면 돔이 다 로드 되고 실행하게 되는걸로 된다.
        // $(function(){
        //     $("*").css("border","1px solid black");
        //
        //     $("#html").css("background","skyblue");
        //     $(".js").css("backgroundColor","orange");
        //     $("li").css("color","white");
        //     $("#html,.js").css("fontSize","25px")
        // })
        window.onload = function() {
            $("*").css("border", "1px solid black");

            $("#html").css("background", "skyblue");
            $(".js").css("backgroundColor", "orange");
            $("li").css("color", "white");
            $("#html, .js").css("fontSize", "25px");
        }

        //아이디선택자



    </script>
    <style>

    </style>
</head>
<body>
<ul>
    <li id = "html">HTML/css</li>
    <li class = "js">javascript</li>
    <li  class = "js">jquery</li>


</ul>
</body>
<!--///선택자.style.속성 == jquery선택자.css();/-->

</html>

댓글 영역