Hello
I would like to make a picture appear and disappear with settimeout in javascript.
That code makes it disappear. How can I make it appear again and then disappear again?
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8" />
5 <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7<title>Document</title>
8 <style>
9 #image {
10 display: block;
11 width: 300px;
12 height: 300px;
13 }
14 </style>
15 </head>
16 <body>
17 <img id="image" src="some picture" ; />
18 <script>
19 let image = document.querySelector("#image");
20 setTimeout(function () {
21 image.style.display = "none";
22 }, 3000);
23 </script>
24 </body>
25 </html>
Thanks for any suggestion