3.12 DOM 基礎事件綁定
click 事件
<button type="button" id="my_btn">按鈕</button>let the_btn = document.getElementById("my_btn");
the_btn.addEventListener("click", function(){
alert("文字訊息");
});認識 disabled 屬性
<button type="button" id="my_btn" disabled>按鈕</button>認識 this 關鍵字
使用 JS 來操控 disabled 屬性
Last updated