diff --git a/change.js b/change.js index 68ec812..245fd88 100644 --- a/change.js +++ b/change.js @@ -5,6 +5,7 @@ let cssbtn2 = document.getElementById("css2"); let cssbtn3 = document.getElementById("css3"); let cssbtn4 = document.getElementById("css4"); + let cssbtn5 = document.getElementById("css5"); cssbtn1.addEventListener("click", (e) => { if (newcss) return; @@ -39,6 +40,14 @@ head.appendChild(newcss); // link要素を追加 }); + cssbtn5.addEventListener("click", (e) => { + if (newcss) return; + newcss = document.createElement("link"); + newcss.rel = "stylesheet"; + newcss.href = "new5.css"; + head.appendChild(newcss); // link要素を追加 + }); + let unlbtn = document.getElementById("unl"); unlbtn.addEventListener("click", (e) => { if (newcss) { diff --git a/index.html b/index.html index 380e0a8..a8e0d51 100644 --- a/index.html +++ b/index.html @@ -141,6 +141,9 @@