<!DOCTYPE html>
<html>
<body>
<span>클릭횟수 : 0</span>
<button id="btn">버튼</button>
</body>
<script>
let cnt = 0;
const button = document.getElementById("btn");
const span = document.querySelector("span");
function handleClick(){
cnt = cnt+1;
span.innerText = `클릭횟수 : ${cnt}`;
}
button.addEventListener("click",handleClick);
</script>
</html>