// 获取元素 let btn1 = document.getElementById("btn1"); //点击事件 btn1.onclick = function (){ console.log("hello") }