返回 JavaScr...... 登陆

JavaScript的核心篇知识

Risco 2018-12-09 16:57:31 195

本章当中  有很多的知识


html中的id  以及属性的增加   和改变   用JavaScript里面的代码去改变css     写时间的  年月  天  时 分秒的  一个写法 与知识点


<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Document</title>

<script type="text/javascript">


var myday=new Date()

document.write(myday+"<br>")

document.write(myday.getFullYear()+"年")

document.write(myday.getMonth()+"月")

document.write("<br>")

var month=new Array(12)

    month[0]="1月"

    month[1]="2月"

    month[2]="3月"

    month[3]="4月"

    month[4]="5月"

    month[5]="6月"

    month[6]="7月"

    month[7]="8月"

    month[8]="9月"

    month[9]="10月"

    month[10]="11月"

    month[11]="12月"

   document.write("这个月是"+month[myday.getMonth()])

document.write("今天是星期"+myday.getDay())

document.write("今天是这个月的第"+myday.getDate()+'天')

document.write("<br>")

document.write("现在是"+myday.getHours()+"时")

document.write(myday.getMinutes()+"分")

document.write(myday.getSeconds()+"秒")

</script>


</head>

<body>


</body>


最新手记推荐

• 用composer安装thinkphp框架的步骤 • 省市区接口说明 • 用thinkphp,后台新增栏目 • 管理员添加编辑删除 • 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消 回复 发送
  • PHP中文网