jQuery, 그리고 객체를 사용해보자

이제 jQuery를 배워봅시다

폰트와 링크, 배경색 제어하기

index.html
<!DOCTYPE html>
<html>
<head>
  <title>WEB1 - Welcome</title>
  <meta charset="utf-8">
  <!-- jQuery를 부릅니다 -->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <!-- 분리시켜놓은 js 파일을 부릅니다 -->
  <script src="colors.js"></script>
</head>
<body>
  <h1><a href="index.html">WEB</a></h1>
  
  <!-- 다크모드로 변경할 수 있는 버튼을 만들어 봅니다
       input 태그를 생성합니다 버튼 타입을 주고 우선 night라고 표기되도록 합니다
       클릭으로 작동합니다.
  -->
  <input id="night_day" type="button" value="night" onclick="
    nightDayHandler(this);
  ">
  <ol>
    <li><a href="1.html">HTML</a></li>
    <li><a href="2.html">CSS</a></li>
    <li><a href="3.html">JavaScript</a></li>
  </ol>
  <h2>WEB</h2>
  <p>웹의 세계에 오신것을 환영합니다.
  </p>
</body>
</html>

Last updated