HTML 놀이

ims·2020년 12월 6일
0

javascript

목록 보기
4/8
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>yeah</title>
</head>
<body>
    <button type="button" class="navyBtn" onClick="location.href='move.html'">이동</button>
    <h1 id="changeButton">바뀔 텍스트</h1>
    <button onclick=change()>누르면 바뀐다</button>
    <script>
        function change(){
            var findHtml = document.querySelector("#changeButton")
            if(findHtml.style.color!="dodgerblue"){
                findHtml.style.color="dodgerblue"
            }else{
                findHtml.style.color="red"
            }
            }
    </script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    이동됐따
    <button onclick="location.href='index.html'">뒤로 이동</button>
</body>
</html>
profile
티스토리로 이사했습니다! https://imsfromseoul.tistory.com/ + https://camel-man-ims.tistory.com/

0개의 댓글