避免按鈕重複點選
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<button id="myBtn">Open Modal</button>
<script>
var btn = document.getElementById("myBtn");
btn.onclick = function() {
alert('test');
this.setAttribute('style', 'pointer-events: none;');
alert('set');
}
</script>
</body>
</html>