From c3d46c329ba43d8c9a6f56ad8771ce4d3af88947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E5=9D=82=E6=98=B4?= Date: Wed, 5 Mar 2025 11:05:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9Ajs=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=20=E5=BC=B9=E7=AA=97=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/js/index.css | 19 +++++++++++++++++++ test/js/index.html | 6 ++++-- test/js/index.js | 7 +++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/test/js/index.css b/test/js/index.css index 830576d..3b52518 100644 --- a/test/js/index.css +++ b/test/js/index.css @@ -2,3 +2,22 @@ margin: 0; padding: 0; } +button { + border: 2px; + border-style: solid; + border-color: rgb(240, 120, 24); + width: 8em; + height: 3em; + color: rgb(255, 255, 255); + background-color: rgb(240, 120, 24); +} + +button:hover { + color: rgb(240, 120, 24); + background-color: rgb(255, 255, 255); +} + +#click_button { + display: block; + margin: 16em auto; +} diff --git a/test/js/index.html b/test/js/index.html index d9f2102..b81054a 100644 --- a/test/js/index.html +++ b/test/js/index.html @@ -4,8 +4,10 @@ - + js测试 - + + + diff --git a/test/js/index.js b/test/js/index.js index e69de29..907350b 100644 --- a/test/js/index.js +++ b/test/js/index.js @@ -0,0 +1,7 @@ +alert('测试'); +document.addEventListener("DOMContentLoaded", function () { + const button = document.getElementById("click_button"); + button.addEventListener("click", function () { + alert("你还真按啊"); + }); +}); \ No newline at end of file