자바스크립트 function
function sayhello(name, age) {
console.log("hello!", name, "i'm", age, "years old");
}
sayhello(han, 15);
-> hello! han i'm 15 years old
<before>
function sayhello(name, age) {
console.log("hello!" + name + "i'm" + age + "years old");
}
<coolthing>
function sayhello(name, age) {
console.log(` hello! ${name} i'm ${age} years old`);
]
----
const title = document.getElementById("title");
title.innerHTML = "hi! From JS"; -> id가 title인 것의 내용을 바꾼다.
title.style.color = "red"; -> id가 title인 것의 색을 바꾼다
condole.dir(title); -> console창에서 확인 할 event를 찾아볼수 있다. 객체인가
window.addEventListener("resize",function'sName);
여기서 finction;sName()으로 하게 되면 resize가 안되도 바로 fuction'sName함수가
호출되는 것이다 ()가 없어야 resize될떄 함수가 호출됨
댓글 없음:
댓글 쓰기