الصفحة الرئيسية
تحميل الكود
تغيير الألوان
تغيير العرض
تغيير حجم العرض
تشغيل الكود
<!DOCTYPE html> <html> <body> <h1>Javascript Asynchronous Code</h1> <p>The alert will be shown after the background color of the page is changed after closing the alert dialog.</p> <button onclick="executeCode()">Click me</button> <script> function executeCode() { // هنا قمنا بإظهار نافذة تنبيه منبثقة بعد مرور ثانيتين setTimeout(() => { alert('The alert is executed second'); }, 2000); // هنا قمنا بتغيير لون خلفية الصفحة document.querySelector('body').style.background = 'khaki'; } </script> </body> </html>