<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.5.0.js" integrity="sha256-r/AaFHrszJtwpe+tHyNi/XCfMxYpbsRg2Uqn0x3s2zc=" crossorigin="anonymous"></script>
<script>
$(function(){
// 배열 가져오기
// document.getElementsByTagName("button");
// btns.onclick = function(){
// alert("POP!!!");
// } 작동하지 않음
var btns = $("button");
btns.on("click",function(){
alert("POP!!!");
})
})
</script>
</head>
<body>
<button id="btn1">Button1</button>
<button id="btn2">Button2</button>
<button id="btn3">Button3</button>
</body>
</html>