JavaScriptDate对象方法:getDay()
编辑您的代码:
var d=new Date()
var weekday=new Array(7)
weekday[0]="Sunday"
weekday[1]="Monday"
weekday[2]="Tuesday"
weekday[3]="Wednesday"
weekday[4]="Thursday"
weekday[5]="Friday"
weekday[6]="Saturday"
document.write("Today it is " + weekday[d.getDay()])
查看结果:
Today it is Saturday
免责申明 --------------------------------------------------------------------------------------
以上内容仅代表原创者观点,其内容未经本站证实,中华考试网对以上内容的真实性、完整性不作任何保证或承诺,转载目的在于传递更多信息,由此产生的后果与中华考试网无关;如以上转载内容不慎侵犯了您的权益,请联系我们
,我们将会及时处理。