Sublime Text
<!DOCTYPE html> <html> <body> <script> var money = 10000; switch (money){ case 2000: document.write("Trà đá"); break; case 8000: document.write("Sting dâu"); break; case 10000: document.write("Cà phê đá"); break; case 12000: document.write("Cà phê sữa"); break; default: document.write("Không món nào có giá bằng đúng với số tiền của bạn"); break; } </script> <h3>(bạn hãy thử thay đổi giá trị của biến money để thấy sự khác biệt)</h3> </body> </html>
<!DOCTYPE html> <html> <body> <script> var money = 10000; switch (money){ case 2000: document.write("Trà đá"); break; case 8000: document.write("Sting dâu"); break; case 10000: document.write("Cà phê đá"); break; case 12000: document.write("Cà phê sữa"); break; default: document.write("Không món nào có giá bằng đúng với số tiền của bạn"); break; } </script> <h3>(bạn hãy thử thay đổi giá trị của biến money để thấy sự khác biệt)</h3> </body> </html>