| 229 | }; |
| 230 | |
| 231 | function backup() { |
| 232 | let div = /*html*/ `<div class="container"> |
| 233 | <div class="inner-container"> |
| 234 | <button id="close-btn">Close</button> |
| 235 | |
| 236 | </div> |
| 237 | </div> |
| 238 | <style> |
| 239 | .container { |
| 240 | position: fixed; |
| 241 | top:0;left:0;right:0;bottom:0; |
| 242 | background: #333e; |
| 243 | display: flex; |
| 244 | justify-content: center; |
| 245 | } |
| 246 | .inner-container { |
| 247 | position: relative; |
| 248 | background: #aaa; |
| 249 | } |
| 250 | #close-btn { |
| 251 | position: absolute; |
| 252 | top: 0; right: 0; |
| 253 | padding: 5px 10px; |
| 254 | } |
| 255 | </style>`; |
| 256 | |
| 257 | let child = document.createElement("div"); |
| 258 | child.innerHTML = div; |
| 259 | document.body.appendChild(child); |
| 260 | |
| 261 | document.querySelector("#close-btn")?.addEventListener("click", function () { |
| 262 | child.remove(); |
| 263 | }); |
| 264 | } |