Generation

特定の日付の時、表示メッセージが変わる

<div class="container" id="main"> <script type="text/javascript"> var today = new Date(); var year = today.getFullYear(); // 年を取得 var month = today.getMonth() + 1; // 月を取得 JANUARY = 0 var day = today.getDate(); // 日を取得 if(month == 3 && day == 14){ document.write("今日は3月14日です"); } else if(month == 3 && day == 15){ document.write("今日は3月15日です"); } else { document.write("今日が3月14日でも3月15日でもありません"); } </script> </div>

Questions about programming?Chat with your personal AI assistant