15th May 2023, 6:48 AM
Måx Üñťį
3 odpowiedzi
+ 9
You can, just wrap your JS code tab in a window.onload function.
15th May 2023, 6:50 AM
Ausgrindtube
Ausgrindtube - avatar
0
Måx Üñťį you can try the <dialog> element. html tab: <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <button class="bt">menu</button> <dialog id="d1">gsbsjxksns</dialog> </body> </html> javascript tab: window.onload = () => { const bt = document.querySelector('.bt'); const d1 = document.querySelector('#d1'); let toggle = false; bt.onclick = () => { toggle = !toggle; toggle ? d1.show(): d1.close(); } }
16th May 2023, 7:26 AM
Bob_Li
Bob_Li - avatar