๋ฐ์ํ
[์ถ์ฒ-์ ํ๋ธ ๋ ธ๋ง๋ ์ฝ๋ Nomad Coders]
-์๋ฐ์คํฌ๋ฆฝํธ๋ HTML๊ณผ CSS๋ฅผ ๋ฐ๊พธ๋ ๊ธฐ๋ฅ์ ํ์ง๋ง ์ด๋ฒคํธ์ ๋ฐ์ํ๊ธฐ ์ํด ๋ง๋ค์ด์ก๋ค
-์ด๋ฒคํธ๋ ์น์ฌ์ดํธ์์ ๋ฐ์ํ๋ ๊ฒ๋ค์ ๋งํ๋ค.
click,resize,submit,input, change, load, before, closing, printing ๋ฑ๋ฑ
-window๋ ์กฐ๊ธ ๋ค๋ฅธ ์ด๋ฒคํธ๋ฅผ ๊ฐ์ง๊ณ ์๋ค
-ํจ์ ๋ค์ ()๋ฅผ ์ฐ๋ฉด ์ง๊ธ ๋ฐ๋ก ํธ์ถํ๋ผ๋ ๋ป
()๋ฅผ ์ฐ์ง์์ผ๋ฉด ํจ์๋ฅผ ๋ฐ๋ก ์ฆ์ ํธ์ถํ์ง์์. ๋งค์ฐ๋งค์ฐ ์ค์!!
const title = document.querySelector("#title");
function handleResize() {
console.log("I have been resized")
}
window.addEventListener("resize", handleResize);
const title = document.querySelector("#title");
function handleResize(event) {
console.log(event);
}
window.addEventListener("resize", handleResize);
const title = document.querySelector("#title");
function handleClick() {
title.style.color = "red";
}
title.addEventListener("click", handleClick);
๋ฐ์ํ
'JavaScript > Vanilla JS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐ๋๋ผJS๋ก ํฌ๋กฌ ์ฑ ๋ง๋ค๊ธฐ] DOM - If else - Function practice (0) | 2021.02.26 |
---|---|
[๋ฐ๋๋ผJS๋ก ํฌ๋กฌ ์ฑ ๋ง๋ค๊ธฐ] If, else, and, or (0) | 2021.02.26 |
[๋ฐ๋๋ผJS๋ก ํฌ๋กฌ ์ฑ ๋ง๋ค๊ธฐ] Modifying the DOM with JS (0) | 2021.02.26 |
[๋ฐ๋๋ผJS๋ก ํฌ๋กฌ ์ฑ ๋ง๋ค๊ธฐ] JS DOM Functions (0) | 2021.02.26 |
[๋ฐ๋๋ผJS๋ก ํฌ๋กฌ ์ฑ ๋ง๋ค๊ธฐ] Your first JS Function (0) | 2021.02.26 |
๋๊ธ