<!DOCTYPE html>
<html>
<body>
<span>Total clicks: 0</span>
<button id="btn">Click me</button>
</body>
<script>
let counter = 0;
const button = document.getElementById("btn");
const span = document.querySelector("span");
function handleClick(){
counter = counter +1;
span.innerText = 'total clicks: &{counter}';
}
button.addEventListener("click", handleClick);
</script>
</html>
1html 만들기 / 2 javascript에서 가져오기 / 3 event 감지 / 4 데이터 업데이트
React.Js는 엔진과 같다/ interactive한 UI를 만들 수 있게 할