Tìm tên trái cây
RUN
<!DOCTYPE html> <html> <head> <title>Tìm tên trái cây</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <script language="javascript"> // Nhập mã trái cây var code = prompt('Nhập mã trái cây', 0); // Biến lưu trữ thông báo var message = ''; // Lấy tên thứ của ngày hiện tại switch (code) { case '1': message = "Trái Đu Đủ"; break; case '2': message = "Trái Xoài"; break; case '3': message = "Trái Mít"; break; case '4': message = "Trái Nhãn"; break; case '5': message = "Trái Chôm Chôm"; break; case '6': message = "Trái Sầu Riêng"; break; case '7': message = "Trái Sầu Riêng"; break; case '8': message = "Trái Chanh"; break; case '9': message = "Trái Dưa"; break; default : message = "Không tìm thấy trái cây"; } // In thông báo document.write(message); </script> </body> </html>
PHÓNG TO