Good afternoon, you need to have a script that opens a hidden div by clicking on the link. Need to make a discovery with a delay of 3 seconds, how to do it? settimeout before the function does not work.
<!DOCTYPE html> <meta charset="utf-8"> <head> <title>Задание 2</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <a href="#" onclick="show('div')">ссылка</a> <div id="div"> Произвольный текст. </div> <script src="main2.js"></script> </body> Js
function show(id) { document.getElementById(id).style.display = 'block'; }