document.querySelect(.클래스명)
- 해당 클래스 명을 가진 첫번 째 클래스만 선택
document.querySelectAll(클래스 명)
- 선택자가 아니라 오로지 클래스 명으로 선택
- 해당 클래스 모두를 선택
document.getElementById("아이디명")
textContent / innerText
const title = document.getElementById("coffee-title")
console.log(title.textContent)
console.log(title.innerText)
- 결과 =>
textContent ; 공백 포함한 텍스트
innerText ; 공백 미포함, 순수 텍스트 만
className
- 클래스 명을 보여줌
- 여러 개의 클래스 명도 모두 보여줌
console.log(title.className)
결과 => title의 클래스 명을 보여줌
style
title