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