Javascript HTML DOM classList Property
description : Javascript HTML (HyperText Markup Language) DOM classList Property
author : 오션
email : shl... 08
The source of the article
Javascript HTML DOM classList Property
Example
<div> 요소에 “mystyle” 클래스를 추가... ody>
<p>Click the button to add the "mystyle" class to DIV.</p>
<button onclick="myFunction()">T
Document querySelectorAll() Method
Example
문서에서 class="example"를 가진 모든 요소를 가져옵니다.
<body>
<h2 class="example">A heading with class="example"</h2> <!-- red 배경색 적용됨 -->
<p class="example">A paragraph with class="example"</p> <!-- red 배
HOW TO
description : How to add active class to current element
author : 오션
email : shlim...
lastupdate : 2021-04-07
Ref
How to add active class to current element
JavaScript를 사용하여 현재 요소에 액티브 클... size: 18px;
}
/* Style the active class, and button on mouse-over */
.active, .bt... button.</p>
<div id="myDIV">
<button class="btn">1</button>
<button class="btn activ
<!DOCTYPE html>
<html lang="en">
<body>
<div class="example">First div element with class="example".</div>
<div class="example">Second div element with class="example".</div>
<p>Click the button to change the text of t
예제1
# 상속 기본
# 슈퍼클래스 및 서브클래스 -> 모든 속성, 메소드 사용 가능
class Car:
"""Parent Class"""
def __init__(self, tp, color):
self.type = tp
self.color... = color
def show(self):
# print('Car Class "Show" Method!')
return 'Car Class "Show" Method!'
class BmwCar(Car):
"""Sub Class"""
구분할 수 있습니다.
단순 선택자 (Simple Selectors) : 이름, id, class 기반 HTML (HyperText Markup Language) 요소들을 선택합니다.
... 소들 사이의 특정 관계에 기반한 요소들을 선택합니다.
의사 클래스 선택자 (Pseudo-class selectors) : 특정 상태에 기반한 요소들을 선택합니다.
의사 요소 선택자 (P... ext-align: center;
color: red;
}
CSS 클래스 선택자 (Class Selector)
class 선택자는 특정 class 속성을 가진 HTML (HyperText Markup Language) 요소들을 선택합니다.
특정 class룰 가진 요소들을 선택하
script>
</body>
</html>
Finding HTML Elements by Class Name
class="intro"를 가진 모든 요소를 반환합니다.
jQuery
<!DOCTYPE html>
<html lang="en">
<head>
<script src="htt... pt>
</head>
<body>
<h2>Finding HTML Elements by Class Name</h2>
<p class="intro">Hello Korea!!</p>
<p class="intro">Hello Bali!!</p>
<p class="intro">Bo
2>
<p>Float boxes side by side:</p>
<div class="clearfix">
<div class="box" style="background-color:#bbb">
<p>Some text inside the box.</p>
</div>
<div class="box" style="background-color:#ccc">
... t inside the box.</p>
</div>
<div class="box" style="background-color:#ddd">