<! DOCTYPE HTML > < HTML lang = "EN" > < head > < Meta charset = "UTF-8" > < title > Get the current week </ title > </ head > < body > < Script of the type = "text / JavaScript " > / * * * Get the current week * * / function getWeekDate () { var now = new new a Date (); was day =now.getDay (); var weeks = new new Array ( " Sunday " , " Monday " , " Tuesday " , " Wednesday " , " Thursday " , " Friday " , " Saturday " ); var Week = weeks [Day]; return Week; } Alert (getWeekDate ()); </ Script > </ body > </html>
From the micro-channel public number: Programming Society
Advanced programmers daily book, please pay attention!